From a3dad55c76c6b8ba7252b6bbe4e8784cec6069b2 Mon Sep 17 00:00:00 2001 From: illusia <64828020+EchoSixHIYA@users.noreply.github.com> Date: Sun, 20 Sep 2026 23:48:31 +0800 Subject: [PATCH] fix: forward native screen share join responses --- src/server/voice-bridge.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/server/voice-bridge.ts b/src/server/voice-bridge.ts index 46574d8..bd8bbdc 100644 --- a/src/server/voice-bridge.ts +++ b/src/server/voice-bridge.ts @@ -1692,6 +1692,17 @@ function parseStreamSignalPayload(raw: string): { cmd: string; args: Record }): ScreenSharePeerSignal | null { const args = payload.args; + // TeamSpeak's native screen-share source wraps the initial SDP in a + // `joinResponse` message after it accepts a viewer's join request. The + // browser-side protocol uses the regular offer shape, so normalize it here + // before forwarding it. Without this mapping the native source can accept a + // viewer while the browser waits forever for its first SDP. + if (payload.cmd === "joinResponse") { + const decision = args.decision; + if (decision === false || decision === 0 || decision === "0") return { kind: "close" }; + const sdp = typeof args.offer === "string" ? args.offer : typeof args.sdp === "string" ? args.sdp : ""; + return sdp ? { kind: "offer", sdp } : null; + } if (payload.cmd === "offer" || payload.cmd === "reconnectOffer") { const sdp = typeof args.offer === "string" ? args.offer : typeof args.sdp === "string" ? args.sdp : ""; return sdp ? { kind: "offer", sdp } : null;