Skip to content

Freeze video by default; --mask-media masks iframes only - #33

Merged
tmashara merged 3 commits into
mainfrom
claude/issue-29-freeze-video
Oct 29, 2026
Merged

tmashara merged 3 commits into
mainfrom
claude/issue-29-freeze-video

Conversation

@tmashara

@tmashara tmashara commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Closes #29

  • Freeze by default (src/capture.ts): prepare() adds an init script that stubs HTMLMediaElement.prototype.play and sets autoplay = false on every media element's loadstart, so from the page's first script on no video plays and each shows its poster, however fast its media loads. As a fallback, before the lazy-load scroll and again after networkIdle, every video (open shadow roots included) is paused; one that played anyway is rewound to 0 and awaited on seeked (2s cap).
  • .vjs-text-track-display, .vjs-control-bar and the control bar's descendants are hidden via visibility in the injected CSS, so the player's own box and styles are still compared.
  • Opt out: --no-freeze-video / config freezeVideo: false (validated as boolean, CLI wins). Added to the --cache-right key; the report's "Pinned" line reflects it.
  • --mask-media narrowed to iframe; README, how-it-works, config example, skill and reference docs updated.
  • Tests: new video guard rail (autoplay, script-played and late-inserted videos with posters; the fixture server delays the right side's clip by 400ms) must come out clean. Before the init script it scored 88.13% on 3 of 3 runs; after, clean on 3 of 3. media fixture: video identical on both sides; bare → diff (iframe), --mask-media → 0 (caption hidden), --mask-media --no-freeze-video → diff.

Behavior changes

  • --mask-media / maskMedia: true no longer masks video. Video boxes are now compared (frozen), so accepted entries and --rerun-failed state from earlier runs may not match.
  • Videos are kept from playing by default, so they show their poster instead of frame 0.
  • --no-freeze-video also drops main's pause/reset during the lazy-load scroll: videos play throughout, so expect unstable pixels or did not settle. With --mask-media as well, video is neither masked nor frozen.

Not covered: videos inside iframes are only covered by the init script (it runs in every frame), not by the pause/seek fallback; --mask-media still masks them.

🤖 Generated with Claude Code

tmashara and others added 3 commits October 29, 2026 11:09
Every video, open shadow roots included, is paused before the scroll and
again after the network settles, with play() stubbed; one that has played
is rewound to frame 0 and awaited on `seeked`, one that hasn't keeps its
poster. video.js text tracks and control bars are hidden. Opt out with
--no-freeze-video or config freezeVideo: false.

Closes #29

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…escendants

An init script stubs play() and turns autoplay off at loadstart, so no
video starts and each keeps its poster however fast it loads. Adds a video
fixture whose clip loads later on the right.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmashara
tmashara merged commit 433f306 into main Oct 29, 2026
3 checks passed
@tmashara tmashara mentioned this pull request Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Freeze or mask video by default

1 participant