diff --git a/server/public/home.html b/server/public/home.html index bd00d87..3930d39 100644 --- a/server/public/home.html +++ b/server/public/home.html @@ -6153,6 +6153,9 @@ async function onMeetMsg(e){ if(_pendingJoinMic){ _pendingJoinMic=false; if(!meetMic){ try{ await toggleMic(); }catch(_){} } } if(_pendingJoinCam){ _pendingJoinCam=false; if(!meetCam){ try{ await toggleCam(); }catch(_){} } } refreshMeetPanel(); updateHostControls(); + // iOS "Share Screen" entry: auto-start the native screen broadcast now that we have a peerId + room, and + // surface the code so the user can hand it to whoever should watch. + if(_autoShareOnJoin){ _autoShareOnJoin=false; setTimeout(()=>{ try{ toggleScreen(); }catch(_){} if(meetRoom) toast('Share code '+meetRoom+' so others can watch your screen.'); }, 800); } return; } // The room is gone (host ended it / code expired). Say so plainly instead of hanging on "Connecting…" @@ -6311,7 +6314,20 @@ const panels=document.querySelectorAll('.panel'); const chatcol=document.getElementById('chatcol'); let loaded={share:false,connect:false}; function currentTab(){ const b=document.querySelector('.railbtn.active'); return b?b.dataset.tab:'chat'; } +let _autoShareOnJoin=false; +// iOS "Share Screen": WKWebView can't capture the P2P remote-support flow, so route it to a screen-share +// MEETING — the native ReplayKit path publishes into LiveKit, and a helper joins by code to watch (+ talk/chat). +// (Viewing a shared screen already works in the webview; only capture is blocked, so only the SHARE side moves.) +function startIosScreenShareMeeting(){ + const NC=nativeCallPlugin(); + if(!NC || typeof NC.startMeetingScreenShare!=='function'){ switchTab('meeting'); toast('Update the app to share your screen'); return; } + if(meetState==='call'){ switchTab('meeting'); toast('You’re already in a meeting — tap Share screen there.'); return; } + _autoShareOnJoin=true; + switchTab('meeting'); + enterMeeting(null); // start an instant meeting; the auto-share fires once meeting-joined gives us a peerId +} function switchTab(tab){ + if(tab==='share' && SFU.on && bzIsIOS()){ startIosScreenShareMeeting(); return; } // iOS: screen-share via a meeting, not the P2P iframe railBtns.forEach(b=>b.classList.toggle('active',b.dataset.tab===tab)); panels.forEach(p=>p.classList.toggle('active',p.dataset.panel===tab)); chatcol.classList.toggle('hidden', tab!=='chat');