Repository navigation
Video: once metadata loads, seek every frozen video to 0 - #82
Merged
Merged
Conversation
A video whose page seeked after metadata lays out at the video's aspect ratio; one that never did keeps the poster's. freezeVideo skipped every unplayed video, so the two sides could differ. It now waits (up to 2s) for metadata on a still-loading video and seeks every loaded one to 0. Fixes #74 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
What
freezeVideonow seeks every frozen video to 0 once its metadata has loaded, played or not. A video that is still loading gets up to 2s forloadedmetadata(orerror) first.Why
A video's box takes the poster's aspect ratio until a seek runs after metadata, and the video's own ratio from then on. A seek before metadata (readyState 0) doesn't count.
freezeVideoskipped every video that hadn't played, which under theplay()stub was every video. So withheight: auto, a page that seeked after metadata on one side and not on the other gave boxes of different heights (360px vs 400px in the new fixture). Seeking every loaded video after metadata makes both sides converge.Behavior changes
--cache-rightentries from earlier runs that contain video may no longer match. The version isn't bumped here, so cache keys stay the same.preload="none". Those are skipped without waiting. OnlyNETWORK_LOADINGvideos get the wait.Bounded waits
Each
freezeVideocall waits at most 2s for metadata, then at most 2s forseeked, per video. Videos run in parallel, so that's 4s per call worst case and 8s per load, since it runs twice. Page timers keep running underpage.clock.install, the same as the existing 2s seek cap.How tested
video-seek: one poster video withheight: auto. The left side seeks insideloadedmetadata, the right side setscurrentTime = 0at parse. On main it fails (exit 1, 80.37% diff on#v). With the change it passes, 3 runs out of 3.videoguard rail is renamed to "stay on frame 0" and still has 0 diff.npm run typecheck,npm run lint,npm run format:check,npm test(308 pass) andnpm run test:visual(335 pass) all pass locally on macOS. No accept hashes were recorded.Docs are updated where the poster behaviour was stated: README, how-it-works, the config JSDoc, the example config and the skill reference.
Fixes #74
🤖 Generated with Claude Code