Repository navigation
fix(detection): a piece whose length is still being read no longer plays - #66
Merged
Merged
Conversation
An HLS or DASH player keeps fetching its pieces, and the newest one's read can still be out when the player picks: unread, it ranked as a stream of unknown length (ten minutes), above a short title's manifest, and as the newest, it played (the live test's HLS in a cross-origin iframe, now and then). A file unread, or unreadable, now counts as a piece when another of the page's sources was read as one and has the same URL but for its numbers. A manifest never does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shape keeps the query's letters, not its numbers: on a site that fetches everything by number through one address, a film still unread counts as a piece once another file there was read as one. settle's summary now names the failed reads too. GLM 5.3's review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On an HLS or DASH page, the player could open a single piece of the stream instead of the stream. That piece never plays. Now a piece whose length is still being read counts as a piece, like the others, and the stream plays.
This changes which stream plays. As you decided tonight, it merges on green CI, and you test the release in your own Firefox later.
What went wrong
Tonight's live test (real streams, main at 6852e43) failed once and passed on the retry. The case was "HLS in a cross-origin iframe that may go fullscreen", with Shaka's 60-second angel-one demo. The player opened
a-eng-0128k-aac-2c-s15.mp4, one audio segment and the last of 38 sources, and it never became playable (readyState 0)..mp4segments count as pieces, which rank below everything.The fix
seg-14.mp4andseg-15.mp4. The query counts too: numbers in it may differ, letters may not. The fragment is ignored.sendSources) and the mpv hand-off's (newestOfLongest).chrome/background/StreamLengths.mjs(lengthsOf,shape) andchrome/background/background.mjs(the two call sites).Tests
Unit,
tests/unit/StreamLengths.test.mjs: one new case with 11 sources:A second check makes sure nothing is guessed when no piece was read.
e2e,
tests/e2e/ext-specs/source-length.e2e.mjs: one new case. A 9-second HLS page fetches its pieces, and the background's read of the third piece is answered only after 5 s.seg-002.mp4: the same symptom as the live test.Local: lint, typecheck, 623 unit tests and the build. CI runs the full e2e suites.
Review: GLM 5.3 reviewed the fix. It confirmed that:
Its doc findings are fixed in the second commit.
Known limits
/get?id=123). On such a site, a film whose read has not finished counts as a piece once another file there was read as one. A short ad's manifest would then play instead. Before, the unread film counted as ten minutes and won. No rule on the URL can tell this film from a piece. The film stays in the sources menu.?Signature=...). They still count as unknown, as before.🤖 Generated with Claude Code