Skip to content

fix(web): disable adaptiveStream so screen-share video isn't paused#29

Merged
ralyodio merged 1 commit into
masterfrom
fix/web-viewer-adaptivestream
Jun 23, 2026
Merged

fix(web): disable adaptiveStream so screen-share video isn't paused#29
ralyodio merged 1 commit into
masterfrom
fix/web-viewer-adaptivestream

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Bug

Web SFU viewers got the host's audio but a black screen for the screen share (even after the fresh-MediaStream-reference fix #28 deployed).

Root cause

useWebRTCSFU creates the Room with adaptiveStream: true. adaptiveStream pauses video tracks that livekit doesn't see attached to a visible element via track.attach(). This code renders through a manually built MediaStream on a <video> srcObject (it never calls track.attach), so livekit saw no visible element and paused the screen-share video at the SFU. Audio is unaffected by adaptiveStream → audio played, video stayed black. (The Chrome egress uses its own subscription, which is why the composite/restream was always fine.)

Fix

adaptiveStream: false. The viewer always shows the single presenter stream, so there's nothing to adaptively pause. Pairs with #28 (fresh MediaStream reference) so Firefox re-binds srcObject when the video arrives.

Test

Assert the Room is constructed with adaptiveStream: false; existing track-merge test still passes. Lint clean.

Web (apps/web) — deploys to Railway on merge.

🤖 Generated with Claude Code

Web SFU viewers got the host's audio but a black screen for the screen share.
The room was created with adaptiveStream:true, which pauses video tracks that
livekit doesn't see attached to a visible element via track.attach(). The
viewer renders through a manually built MediaStream on a <video> srcObject, so
livekit never registers the element and paused the video at the SFU — audio
(unaffected by adaptiveStream) kept flowing, video stayed black.

Disable adaptiveStream: the viewer always shows the single presenter stream,
so there's nothing to adaptively pause. (Pairs with the prior fresh-MediaStream
-reference fix so Firefox actually re-binds srcObject when the video arrives.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ralyodio ralyodio merged commit 36689e8 into master Jun 23, 2026
@ralyodio ralyodio deleted the fix/web-viewer-adaptivestream branch June 23, 2026 10:55
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant