feat(web-ui): seamless channel switch with dual video slots#538
Conversation
Use two stacked video elements so channel changes and out-of-buffer seeks load on a hidden player while the current stream keeps playing, then swap once the new stream starts to avoid black-screen gaps. Co-authored-by: Cursor <cursoragent@cursor.com>
Limit seamless hard-switch to channel or source line changes; keep seek and EPG reloads on a single slot. Always reveal the new slot on load failure, fix video layering/centering, and rebuild embedded web UI. Co-authored-by: Cursor <cursoragent@cursor.com>
Always stretch video to a 16:9 frame, remove the force-16:9 setting, and size the frame with ResizeObserver for broader browser support. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-538.eastasia.1.azurestaticapps.net |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d227f1994
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ects Skip dual-slot when paused, unify retry segment reload, and sync player settings via explicit effects instead of suppressing exhaustive-deps. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-538.eastasia.1.azurestaticapps.net |
There was a problem hiding this comment.
Pull request overview
This PR updates the web UI player to support seamless channel/source switching by preloading the next stream in a hidden “slot” and hard-switching once playback starts, while also removing the force-16:9 toggle in favor of a ResizeObserver-sized 16:9 frame with stretched video rendering.
Changes:
- Implement dual video-slot playback in
VideoPlayerto enable seamless channel/source switching during active playback. - Remove the “Force 16:9” setting and its persisted storage/i18n strings.
- Replace CSS container queries with ResizeObserver-driven sizing for a 16:9 video frame and
object-fit: fill.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web-ui/src/pages/player.tsx | Removes force-16:9 state/plumbing from the player page and settings wiring. |
| web-ui/src/lib/player-storage.ts | Drops persisted storage for the removed force-16:9 option. |
| web-ui/src/index.css | Replaces container-query sizing with styles supporting ResizeObserver-sized 16:9 frame and stretched content. |
| web-ui/src/i18n/player.ts | Removes i18n strings for the deleted force-16:9 setting. |
| web-ui/src/components/player/video-player.tsx | Core implementation of dual-slot seamless switching, ResizeObserver sizing, and updated event handling for two video elements. |
| web-ui/src/components/player/settings-dropdown.tsx | Removes the force-16:9 toggle UI and related props. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Gate seamless switch on active playback, fall back to in-place load when hidden slot creation fails, fix duplicated media error label, and revert default 16:9 stretch / ResizeObserver changes from this PR. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-538.eastasia.1.azurestaticapps.net |
Pass channel id and source index from VideoPlayer when playback starts to avoid stale closure overwriting localStorage. Revert embedded_web_data.h to main so this PR does not include rebuilt embed artifacts. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-538.eastasia.1.azurestaticapps.net |
Clone object defaults in createStore so mutating the returned map does not alias defaultValue and skip setItem. Revert the redundant playback callback signature change from the prior attempt. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-538.eastasia.1.azurestaticapps.net |
Only use seamless switching in live mode so automatic catchup fallback to another source line reloads in-place like a seek. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-538.eastasia.1.azurestaticapps.net |
Expose dual-slot channel switching as a user setting (default on) and fix container sizing so force 16:9 letterboxing fills the player correctly. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-538.eastasia.1.azurestaticapps.net |
Only lock the player container to 16:9 when force 16:9 is enabled; let 4:3 and other native ratios size the mobile viewport by video height. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-538.eastasia.1.azurestaticapps.net |
Always display video in 16:9 and drop the toggle, storage key, and native-ratio layout path. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-538.eastasia.1.azurestaticapps.net |
Track retry-seek with a ref instead of batched state toggles so segment updates from recovery do not reset backoff counters. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-538.eastasia.1.azurestaticapps.net |
Align code identifiers and storage key with the seamless switch setting name. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-538.eastasia.1.azurestaticapps.net |
Summary
loadSegmentsbehavior.ResizeObserverinstead of CSS container queries.Test plan
Made with Cursor