When a screenshare was started while both peers were already connected, the viewer never received the video stream. This worked after a reload because the peer_joined handler proactively sends an offer to the new peer. The root cause: startSharing() relied on a request_stream round-trip (viewer sends request_stream, sharer responds with offer). Since handleSignal is async but never awaited by ws.onmessage, this round-trip could silently fail when promises rejected or messages interleaved during the exchange. Fix by having the sharer proactively send offers to all connected peers in startSharing(), matching the existing peer_joined behavior. Also add a fallback in ontrack for when event.streams is empty. https://claude.ai/code/session_01ALSwS4S8EHiP81i2KMsb9Y |
||
|---|---|---|
| .. | ||
| index.html | ||