KASM-4146 check browser support for webrtc
This commit is contained in:
parent
866c2772f0
commit
d1419f9430
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue