Repository navigation
Conversation
Live MPEG-TS from Xtream-style panels starts with a server-side backlog burst (~20-30 s), so viewers watch far behind live. mpv can seek inside its demuxer cache on these non-seekable streams; a jump to cache end minus 3 s cut measured latency from ~23 s to ~3 s, and TS self-heals after at most one short stall because data keeps arriving at 1x. The button is TS-only on purpose: HLS delivers whole segments and its cache ends at the newest complete segment. Leaving 3 s there reproduced the live_start_index=-1 behaviour (a stall plus A/V resync with dropped frames on every segment). Making HLS safe needs the provider's segment length, which the player cannot know reliably. - PlayerController contract: `liveEdge` capability and `jumpToLiveEdge()` command; web adapters keep them off. - EmbeddedMpvLiveEdge gates on live + mpv `file-format` mpegts, seeks by bufferedAheadSeconds - 3 via the relative seekBy (no-op at <= 3 s) and ignores repeats for 2 s, since the reply snapshot can still carry the pre-seek buffer. - fast_forward button right of play, always enabled, in the shared controls (frame-copy) and the native-view legacy dock. The shared transport row becomes a `1fr auto 1fr` grid so play stays centred when the button appears. - ControlsTransport takes the +-10 s seek and the jump out of PlayerControlsComponent (max-lines). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; no actionable issue was found. SummaryAdds “Jump to live” to Embedded MPV for live MPEG-TS streams.
Review checks were based on source and supplied tests; no runtime or visual verification was performed. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Shared controls or legacy dock] --> B{Live MPEG-TS?}
B -->|No| C[No jump]
B -->|Yes| D{Playing or paused, no reconnect?}
D -->|No| C
D -->|Yes| E{Buffer above 3 seconds and lockout expired?}
E -->|No| C
E -->|Yes| F[Seek forward by buffer minus 3 seconds]
F --> G[Ignore repeat jumps for 2 seconds]
Reviews (1) · Last reviewed commit: "feat(playback): jump to live for Embedde..." · Reviewed by Greptile |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2211 +/- ##
==========================================
+ Coverage 81.63% 81.88% +0.25%
==========================================
Files 1884 1907 +23
Lines 98631 101684 +3053
Branches 23005 24861 +1856
==========================================
+ Hits 80514 83266 +2752
- Misses 11085 11130 +45
- Partials 7032 7288 +256
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Adds a jump to live button (⏩
fast_forward) to Embedded MPV, right of play/pause, for live MPEG-TS streams only. One click skips the backlog mpv has buffered and leaves 3 s of buffer, so you watch a few seconds behind the broadcast instead of 20–30 s. That matters most for sports.This is a proposal. Feel free to iterate on placement, the 3 s target or naming.
Screenshots
Before the jump: a long buffer right after opening a live
.tschannel.After the jump: a short buffer.
The control bar: the button right of play, which stays centred.
Why live latency is high with
.tsAn Xtream
.tslive stream is one endless HTTP response. Many panels answer a new connection with a burst of their own backlog (measured: ~23–29 s of video within 2.5 s) and then send at real-time speed. mpv starts playing at the beginning of that burst, so you stay ~23 s behind live for the whole session. Every channel change or reconnect repeats the burst.mpv reports these streams as "not seekable", but it can seek inside what it has already buffered. Jumping to "buffer end − 3 s" took the measured delay from ~23 s down to ~3 s. TS then heals itself: after at most one short stall right after the jump, data keeps arriving continuously and the buffer stays stable. 3 s covers normal delivery jitter; smaller targets brought no lasting gain.
Why the button is TS-only (and not for m3u8)
HLS (
.m3u8) does not deliver a continuous stream. It delivers whole segments, often ~10 s each, and mpv's buffer ends at the newest complete segment.live_start_index=-1: a stall on every segment, each followed by an audio restart and an audio/video resync that drops frames. Visually, the picture jumps and stutters.Making HLS safe would require the provider's segment length (to keep about one segment in reserve). The player can't know it reliably without heuristics, so the button simply doesn't exist for HLS. The
Autostream format still prefersm3u8; users who want low latency can switch tots.What changed
liveEdgecapability and ajumpToLiveEdge()command. Web adapters keep it off.EmbeddedMpvLiveEdge): the button shows only for live playback whose mpvfile-formatismpegts, so it works for Xtream, M3U and Stalker alike. A click seeks bybufferedAheadSeconds − 3through the existing relativeseekBy; with ≤ 3 s buffered it does nothing. Repeats are ignored for 2 s, because the snapshot that answers the seek can still carry the old buffer value.1fr auto 1frgrid, so play stays centred when the button appears.ControlsTransport, becausePlayerControlsComponentwas at the line limit.EMBEDDED_MPV.PLAYER.JUMP_TO_LIVEin all locales.embedded-mpv-native.md(new "Jump to live (MPEG-TS)" section) and an Xtream compatibility note..changes/playback-embedded-mpv-jump-to-live.md.Testing
ui-playbackunit tests: 1723 passed, including new tests for:Possible follow-ups (out of scope)
tsfor lower latency.🤖 Generated with Claude Code