Skip to content

feat(stream): fitToScreen deep link + re-encode on resize#398

Open
joshfriend wants to merge 1 commit into
NetrisTV:masterfrom
joshfriend:feat/fit-to-screen-on-resize
Open

feat(stream): fitToScreen deep link + re-encode on resize#398
joshfriend wants to merge 1 commit into
NetrisTV:masterfrom
joshfriend:feat/fit-to-screen-on-resize

Conversation

@joshfriend

Copy link
Copy Markdown
Contributor

Adds a fitToScreen stream URL param and re-encodes the stream to the container size on resize.

  • ?fitToScreen=1 deep link: start a stream already fit to its container without going through the Configure screen. Useful for embedded/auto-started streams.
  • Re-encode on resize: when the player is in fit-to-screen mode, a debounced (300ms) window-resize handler recomputes the container bounds and resends video settings, so the feed settles at native resolution instead of staying CSS-scaled. Inert for fixed-resolution streams. The resize listener/timer is cleaned up on disconnect.

Important

Requires #390 to work properly. Without #390 the canvas is still pinned to the raw video resolution and letterboxing/scaling doesn't happen, so the re-encode has nothing to fit into. #390 provides the responsive CSS layout (object-fit: contain) and removes the parent-element size pin; this PR builds on that to keep the feed crisp after a resize settles.

Builds on NetrisTV#390 (Leo Forney). Adds a fitToScreen URL param so a stream can be
deep-linked already fit to its container without going through the Configure
screen. With the canvas now CSS-fit by NetrisTV#390, also re-encode the stream at the
new container bounds (debounced) on window resize when the player is in
fit-to-screen mode, so the feed settles at native resolution instead of being
CSS-scaled. Inert for fixed-resolution streams.
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