diff --git a/app/ui.js b/app/ui.js index 4c4e3ef1..c51a0e66 100644 --- a/app/ui.js +++ b/app/ui.js @@ -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 { diff --git a/core/rfb.js b/core/rfb.js index 58557019..4f17fcef 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -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); }