fix(webrtc): use TURN on desktop too (screen share blank/disconnect)
TURN relay candidates were applied only when IS_MOBILE, leaving desktop clients STUN-only. Customers behind symmetric NAT / corporate firewalls / VPNs then couldn't establish the peer connection -> connectionState 'failed' -> "connection lost" -> blank screen right after granting permissions. This hit only some users (those needing a relay). Apply the /api/ice config (STUN + managed TURN) regardless of device, in both the customer (share.html) and agent (connect.html) flows. Requires TURN_URLS / TURN_USERNAME / TURN_CREDENTIAL to be set in the production environment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Dieser Commit ist enthalten in:
@@ -68,7 +68,7 @@
|
|||||||
<script>
|
<script>
|
||||||
let ICE={iceServers:[{urls:'stun:stun.l.google.com:19302'}]};
|
let ICE={iceServers:[{urls:'stun:stun.l.google.com:19302'}]};
|
||||||
const IS_MOBILE=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(navigator.userAgent||'');
|
const IS_MOBILE=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(navigator.userAgent||'');
|
||||||
let __icePromise=Promise.resolve();try{__icePromise=fetch('/api/ice').then(r=>r.ok?r.json():null).then(c=>{if(c&&c.iceServers&&IS_MOBILE)ICE=c;}).catch(()=>{});}catch(_){}
|
let __icePromise=Promise.resolve();try{__icePromise=fetch('/api/ice').then(r=>r.ok?r.json():null).then(c=>{if(c&&c.iceServers)ICE=c;}).catch(()=>{});}catch(_){}
|
||||||
async function ensureIce(){try{await __icePromise;}catch(_){}return ICE;}
|
async function ensureIce(){try{await __icePromise;}catch(_){}return ICE;}
|
||||||
function pEsc(s){return String(s==null?'':s).replace(/[&<>"]/g,c=>({'&':'&','<':'<','>':'>','"':'"'}[c]));}
|
function pEsc(s){return String(s==null?'':s).replace(/[&<>"]/g,c=>({'&':'&','<':'<','>':'>','"':'"'}[c]));}
|
||||||
// When embedded in the home shell, tell the parent when a session is live so the
|
// When embedded in the home shell, tell the parent when a session is live so the
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ let ICE={iceServers:[{urls:'stun:stun.l.google.com:19302'}]};
|
|||||||
let SHARER_NAME='Customer';
|
let SHARER_NAME='Customer';
|
||||||
try{fetch('/api/me').then(r=>r.ok?r.json():null).then(m=>{if(m&&(m.name||m.email))SHARER_NAME=m.name||m.email;}).catch(()=>{});}catch(_){}
|
try{fetch('/api/me').then(r=>r.ok?r.json():null).then(m=>{if(m&&(m.name||m.email))SHARER_NAME=m.name||m.email;}).catch(()=>{});}catch(_){}
|
||||||
const IS_MOBILE=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(navigator.userAgent||'');
|
const IS_MOBILE=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(navigator.userAgent||'');
|
||||||
let __icePromise=Promise.resolve();try{__icePromise=fetch('/api/ice').then(r=>r.ok?r.json():null).then(c=>{if(c&&c.iceServers&&IS_MOBILE)ICE=c;}).catch(()=>{});}catch(_){}
|
let __icePromise=Promise.resolve();try{__icePromise=fetch('/api/ice').then(r=>r.ok?r.json():null).then(c=>{if(c&&c.iceServers)ICE=c;}).catch(()=>{});}catch(_){}
|
||||||
async function ensureIce(){try{await __icePromise;}catch(_){}return ICE;}
|
async function ensureIce(){try{await __icePromise;}catch(_){}return ICE;}
|
||||||
function pEsc(s){return String(s==null?'':s).replace(/[&<>"]/g,c=>({'&':'&','<':'<','>':'>','"':'"'}[c]));}
|
function pEsc(s){return String(s==null?'':s).replace(/[&<>"]/g,c=>({'&':'&','<':'<','>':'>','"':'"'}[c]));}
|
||||||
// When embedded in the home shell, tell the parent when a session is live so the
|
// When embedded in the home shell, tell the parent when a session is live so the
|
||||||
|
|||||||
In neuem Issue referenzieren
Einen Benutzer sperren