Repository navigation
fix(web): keep a seek made before a direct-played original loads while a quality change is queued - #4512
Conversation
…e a quality change is queued On an original file whose metadata had not loaded yet, a seek was held for the metadata handler but never reported to the playback session, and was not remembered for the replan in flight. A quality or track change queued behind that replan still resumed where it was picked, and the first replacement stream could start there too. That seek now takes the same path as an in-stream seek: it reports to the session and is remembered for the replanned stream.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Review summaryReviewed head: What I checked
Defects that predate this PR The cross-provider round and a code-review finder found five paths where a seek made during a replan is still lost: a failed replan before metadata loads, a replacement that can't seek anywhere, a held room request, the browser decoder, and an out-of-window seek while a change is queued. Each one behaves the same on Validated features No passed case on the v1.0 board is affected. #199 (Movies — Web) has no recorded case results. Seek and marker cases that passed elsewhere (#1149 C2, #1156 C2) use User manual: unaffected. This fixes a playback position; no setting, label or documented step changes. Other clients: the direct-play clock-origin wait is specific to the web player. The Apple, Android and Roku N/A entries hold. Fit: 9/10 · Readiness: 9/10 — ready
🤖 Claude Code (claude-opus-5-5) |
Resolve the seek conflict with main's takeSeek() helper (#4512), keeping the draining-stream reconnect after it. Port the PR's lost-connection tests onto main's pruned VideoPlayer.test.tsx (#4465) and take main's deletion of mediaTimeline.test.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Problem
Closes #4069
Related issue: N/A
Validation tasks: none (#199 has no recorded case results)
Other clients: Apple N/A (web player only); Android N/A (web player only); Roku N/A (web player only)
In the web player, a seek on an original file that plays in the media element was lost if the file's metadata had not loaded yet and a quality or track change was queued. The player showed the seek, but the queued change still started where it was picked, and playback jumped back there. This fixes that path. The issue's other path, an out-of-window seek while a change is queued, already works on
main.The issue names two paths:
seek_reanchor). Already fixed onmain:replaninusePlaybackSessionnow moves a queued quality, track or output change to the reanchor's position. I checked this on a local build ofmain(steps under Validation). The queued change is sent with the seek position and plays from there.main. ThedirectPlayOriginPendingRefbranch ofperformPlayerSeekremembered the seek for the metadata handler. It did not report the seek to the session (onSeek, added in fix(web): keep a seek when a queued quality or track change runs #4025) and did not setreplanSeekRef(added in fix(web): keep a seek made while a quality change loads #3988). The queued change kept its old position. The first replacement stream could also start at the old position before playing, and its controls showed that position.Approach
A seek in the pre-metadata branch now goes through the same steps as an in-window seek. It is remembered as the pending seek and kept for the replan in flight, the session is told about it, and the controls show it. The metadata handler still seeks the original there once its clock is known. Web only. No API, server or client app changes.
Validation
mainin headless Chromium on the production bundle. Browser decoding was off, so the original plays in the media element. The fixture is a synthetic 5-minute H.264/AAC MP4 with two audio tracks. Steps: play at 720p near 120 s, then switch to Auto, which direct-plays the original. Hold the original's media request so its metadata cannot load. Pick 720p (replan held 4 s), then 480p (queued), then click the seek bar at 30 s. The queued 480p request went out with 121.9 s, and playback ended up at about 122 s. On this branch, with the same steps and data, it goes out with 29.9 s and plays from about 30 s.mainand on this branch.VideoPlayertest now runs the "new stream and a later quality change start at the seek" case on both a playing stream and an original whose metadata has not loaded. The second fails onmain.pnpm run lint,pnpm run format:check,pnpm run build,pnpm run budget:check,make test-web,make verify-local-paths,make verify-bidi,make verify-size-ratchetandmake verify-case-collisionspass. No Go code changed, so the Go half of the gate was not run.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-4512/
Surface and build: web app player at 1440px, the same steps on a local build of
mainand of this branch. Position log excerpt (seek bar position in seconds):Phone width is unaffected: the change is in where the stream starts, not in the layout.
Risks
None identified for this change. Two existing limits apply to every seek made during a replan, not only this path. A first replacement stream whose plan cannot seek anywhere (a progressive remux) still starts at its plan's position until the queued change lands. During an out-of-window seek (path 1), the seek bar shows the old position until the queued change's stream plays.
Checklist
AI Disclosure