fix webrtcconfig and allow stun servers #6309

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458
2024-09-03 13:42:06 +01:00
parent 7b48e3b5f5
commit ac0d805378
5 changed files with 27 additions and 7 deletions

View File

@@ -1560,6 +1560,8 @@
var debugmode = 0;
var windowsBrowser = detectWindowsBrowser();
var attemptWebRTC = ((features & 128) != 0);
var webrtcconfiguration = '{{{webrtcconfig}}}';
if (webrtcconfiguration == '') { webrtcconfiguration = null; } else { try { webrtcconfiguration = JSON.parse(decodeURIComponent(webrtcconfiguration)); } catch (ex) { console.log('Invalid WebRTC config: "' + webrtcconfiguration + '".'); webrtcconfiguration = null; } }
var passRequirements = '{{{passRequirements}}}';
if (passRequirements != '') { passRequirements = JSON.parse(decodeURIComponent(passRequirements)); }
var customui = '{{{customui}}}';
@@ -9292,6 +9294,7 @@
desktop.debugmode = debugmode;
desktop.m.debugmode = debugmode;
desktop.attemptWebRTC = attemptWebRTC;
desktop.webrtcconfig = webrtcconfiguration;
desktop.options = {};
if (tsid != null) { desktop.options.tsid = tsid; }
if (consent != null) { desktop.options.consent = consent; }

View File

@@ -83,7 +83,7 @@
var meshMessengerImage = '{{{meshMessengerImage}}}';
var remoteUserName = '{{{username}}}';
var remoteUserId = '{{{userid}}}';
var webrtcconfiguration = '{{{webrtconfig}}}';
var webrtcconfiguration = '{{{webrtcconfig}}}';
if (webrtcconfiguration == '') { webrtcconfiguration = null; } else { try { webrtcconfiguration = JSON.parse(decodeURIComponent(webrtcconfiguration)); } catch (ex) { console.log('Invalid WebRTC config: "' + webrtcconfiguration + '".'); webrtcconfiguration = null; } }
var windowFocus = true;
var chatTextSession = new Date().toString() + '\r\n';