Description
Problem
When the web player's <video> element fires ended, handleEnded in web/src/player/components/WatchPage.tsx reports positionSeconds: session.durationSeconds, whatever position the element actually stopped at. VideoPlayer.tsx's onVideoEnded then runs the post-roll and next-episode flow. So any stream that ends early but cleanly is saved as watched to the end, and the next episode starts.
#3512 was one way to get there: a progressive remux whose source stopped being readable ended its response cleanly at minute 20 of 45. The server half of that is fixed separately, so a source read error now breaks the response and reaches the player as MEDIA_ERR_NETWORK. Other clean early ends can still happen, for example a remux whose FFmpeg exits 0 for a reason the server doesn't recognise, or a file that is shorter on disk than its catalogued runtime because it was truncated after the scan.
Who it affects
Web UI viewers on any delivery where the media element can reach ended before the real end of the title.
Current workaround
Mark the episode unwatched by hand and go back to it.
Proposed behavior
An ended well short of the known runtime is not recorded as finishing the title: the saved position is where playback actually stopped, the title isn't marked watched, and the player doesn't auto-advance. It could instead go to the existing connection-lost handling, or show an error.
This needs care with the threshold. source.duration_seconds can differ a little from the real stream length, so a legitimate end must not be treated as an outage. Passing the element's position through VideoPlayer.tsx's onEnded overlaps the area open PR #2498 changes, so it's best done after that lands.
Alternatives considered
Leaving it to the server. The server can only break responses it knows are short, so the client still needs its own check.
AI harness
Claude Code (desktop app)
AI tool(s)
Claude Code
AI model(s)
claude-opus-5-5
AI involvement
AI-assisted
Independent or adversarial review
n/a
Confirmations
- I searched open and closed issues, including ones closed as not planned, and this is not already requested
- This is not one of Silo's non-goals
Activity
Rhainland commentedon Nov 15, 2026
Reproduced on
origin/mainat c11b0a9 in the web player. I used a TV library of three 180 s episodes, then replaced episode 2 with a 60 s file after the scan, so Silo still expected 180 s. The video firedendedat 60 s, "Up next" appeared, and episode 3 started on its own 10 s later.The saved progress is already right. The last progress report sent position 60, and the server stored 60/180, not completed, not played, with no completed history row. The server applies the watched threshold to the real position. The
durationSecondsthathandleEndedreports only reaches the client-side cache for multi-part files. What is wrong is the post-roll and next-episode flow running after a stream that ended early.Two choices need a maintainer before a fix:
playback.watched_threshold, default 90%) is an admin setting that no viewer-facing API exposes. Reusing it in the web client means a new/api/v2field with a capability check, and matching work in the Apple and Android apps. The cheaper option is the web player's existing 30 s post-roll window (POST_ROLL_SECONDS_BEFORE_END). The two disagree: ending 60 s short of a 45-minute episode is watched under 90% but early under 30 s.With those settled, the change is small:
onVideoEndedandhandleEndedreport the element's real position and skip the finish flow on an early end.AI disclosure: reproduced by Claude Code (claude-opus-5-5) at the maintainer's direction.
Quick104 commentedon Nov 25, 2026
A data point from agent runtime testing for validation task #199 on build 2970 ·
a16a24720: playing a truncated film (#5339) and seeking past where its data ends closed the web player, and the film was marked watched, unlike the repro above where the server kept the real position. Which position the player reported wasn't captured; Chrome most likely took the length from the file header.Evidence: https://evidence.siloserver.org/r/silo-server/v1-validation-199/
Posted with Claude Code (claude-sonnet-5-5 testing, claude-opus-5-5 verification) and GitHub CLI at the maintainer's direction.