iOS remote support: Share Screen -> Connect Screen over LiveKit (core)
Rebuild the iOS remote-support screen share the RIGHT way: keep the exact Share/Connect UX + session (consent + symmetric session-ended), swap only the media to LiveKit since WKWebView can't getDisplayMedia. (Replaces the earlier "route to a meeting" detour, which was reverted.) Flow: customer taps Share Screen -> gets a 6-digit code (unchanged UI) -> helper enters it in Connect Screen -> on the customer's "Allow", the app publishes the screen natively (ReplayKit -> LiveKit) into a per-session room and tells the agent it's a LiveKit session -> connect.html joins that room and shows the screen in its existing viewer (recording/controls intact). Chat runs over the session socket (no P2P data channel in this mode). Either side ending fires the existing session-ended -> both tear down (symmetric disconnect). - signaling.js: relay 'rs-livekit' + 'rs-chat' between the two ends. - home.html: parent bridge so the /share iframe can drive startMeetingScreenShare/ stop on the native plugin (+ a capability handshake). - share.html (iOS): publish via native LiveKit instead of getDisplayMedia; chat over WS; hide mic (voice = next iteration) + remote-control (impossible on iOS). - connect.html: LiveKit viewer for iOS-shared sessions, reusing the P2P viewer. Web-only, no new build (reuses the shipped startMeetingScreenShare). Desktop Share/Connect P2P unchanged. Two-way voice is the planned follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -373,6 +373,16 @@ async function handle(ws, m, req) {
|
||||
if (peer && peer.readyState === 1) peer.send(JSON.stringify(m));
|
||||
break;
|
||||
}
|
||||
// iOS remote-support over LiveKit: 'rs-livekit' tells the OTHER end this session's media runs over a
|
||||
// LiveKit room (WKWebView can't getDisplayMedia); 'rs-chat' carries chat since there's no P2P data
|
||||
// channel in that mode. Relayed between the two ends exactly like offer/answer/transcript.
|
||||
case 'rs-livekit': case 'rs-chat': {
|
||||
const sess = liveSessions.get(m.sessionId || ws.sessionId);
|
||||
if (!sess) return;
|
||||
const peer = ws === sess.agentWs ? sess.viewerWs : sess.agentWs;
|
||||
if (peer && peer.readyState === 1) peer.send(JSON.stringify(m));
|
||||
break;
|
||||
}
|
||||
case 'end-session': {
|
||||
await endSession(ws.sessionId, m.reason || null);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user