Merge pull request #62 from kasmtech/feature/KASM-4164_rtcpeer_undefined

KASM-4146 check browser support for webrtc
This commit is contained in:
j-travis 2023-03-21 01:50:07 -04:00 committed by GitHub
commit 36e10ef6ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -2175,6 +2175,11 @@ const UI = {
toggleWebRTC() {
if (UI.rfb) {
if (typeof RTCPeerConnection === 'undefined') {
UI.showStatus('This browser does not support WebRTC UDP Data Channels.', 'warn', 5000, true);
return;
}
if (UI.getSetting('enable_webrtc')) {
UI.rfb.enableWebRTC = true;
} else {

View File

@ -1074,7 +1074,7 @@ export default class RFB extends EventTargetMixin {
this._resendClipboardNextUserDrivenEvent = true;
// WebRTC UDP datachannel inits
{
if (typeof RTCPeerConnection !== 'undefined') {
this._udpBuffer = new Map();
this._udpPeer = new RTCPeerConnection({
@ -1179,7 +1179,7 @@ export default class RFB extends EventTargetMixin {
}
}
if (this._useUdp) {
if (this._useUdp && typeof RTCPeerConnection !== 'undefined') {
setTimeout(function() { this._sendUdpUpgrade() }.bind(this), 3000);
}