Repository navigation
fix(core): Safari video picture lands on the cut again, undoing the hidden pre-roll - #7383
Merged
Merged
Conversation
…idden pre-roll Reverts the one-second hidden video pre-roll (#7265): on Safari the pre-rolled video is still behind at the cut and trails it by 30 to 150 ms in every measured run, and some cut flashes never show.
miguel-heygen
force-pushed
the
rsafari/picture-preroll
branch
from
November 7, 2026 21:37
c6a14b6 to
48ebce3
Compare
Contributor
Contributor
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head 48ebce32
Scope
- Diffed the change against a straight revert of #7265 (
3e86def5). The content is the same, line for line, except for the comment lines trimmed at48ebce32. Fromc6a14b6bto48ebce32only comments changed. startedEarly,isRenderDriven,steerHiddenandHIDDEN_GAIN: no leftover uses.startedEarlyitself predates #7265 and stays.- Main changed
media.tsafter #7265 (#7355, #7368). The revert applies to those changes without conflict, and Typecheck and Test pass. - The player size budget goes back to its value before #7265, and CI passes with it.
- "fails without the fix" names real tests that fail on main: the learned-latency and preseek tests, which import
resetVideoStartLatency. - The Safari timing figures in the body come from the author's own runs. I didn't reproduce them.
- CI at this head: CI, Comments, CodeQL, Player Safari audio, Player perf, PR captures and preview-regression pass. regression, Windows render and Player Safari perf were still running when I posted.
- No prior reviews.
— genesis-v2
miguel-heygen
enabled auto-merge
November 7, 2026 21:52
6 of 7 tasks
Merged
3 of 5 tasks
SanHsien
added a commit
to SanHsien/hyperframes
that referenced
this pull request
Nov 9, 2026
Port the adopted upstream fixes from f5bde95 to the current upstream tip: heygen-com#7375 multipart cloud upload, heygen-com#7382 minParallelChunks, heygen-com#7349 HLG header SEI, heygen-com#7369 skip unmounted compositions in lint/check, heygen-com#7381 filesystem-path media in the cloud archive, heygen-com#7383 Safari cut-point pre-roll revert, heygen-com#7373 clock steering between audio time updates, heygen-com#7384 injector test isolation, heygen-com#7378 preview seek retention, heygen-com#7390 virtual timer schedule per worker, heygen-com#7394 CDN script failure naming, heygen-com#7395 menu row radius, heygen-com#7119 decode timeout caller test, heygen-com#7397 authored tween order, heygen-com#7402 capture page clip loading, heygen-com#7412 muted video audio track at cuts, heygen-com#6150 template root variable test, heygen-com#7442 held tail seek once. Deliberate local differences: heygen-com#7067's audio-start hold is not carried into clock.ts, mountedSources comes from heygen-com#6827 as a helper only, cloud/_gen/types.ts omits the image-request types the fork does not generate, and the lint symlink test skips through symlinkOrSkip where the account cannot create links. Co-Authored-By: Claude Sonnet <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.
What
Undoes #7265. On Safari the video's picture lands about 100 ms behind the cut (iPhone Simulator) and 30 to 50 ms behind (desktop Safari) with the one-second hidden pre-roll, and on the Simulator 3 to 9 of the 44 scored cues per run show no picture flash at all (0 or 1 without it). Without it the picture is on the cut or one frame early in 2 of 3 Simulator runs and 1 of 3 desktop Safari runs, and about 100 ms late in the others. Chrome is the same either way. Sound timing is not touched (identical before and after).
Why
#7265 was measured by the timeline-versus-frame display time inside the page. Measured on what the machine outputs (screen buffers and system audio with their own timestamps), the picture on the pre-roll build trails the timeline in every run on Safari. The pre-rolled video plays hidden for up to a second while steered at up to twice its speed, but in the Simulator's per-frame trace it advances at about 1.3x, not 2x, after a 150 to 400 ms freeze following
play(), so it is 175 to 820 ms behind at the cut and the visible-phase steering (at most 10%) then closes it over one to two seconds.Related work
Refs #7265. Not a full fix of the picture trailing a cut: the pre-#7265 timing is bimodal (about on time or about 100 ms late, run to run), and this does not change that; it removes a build that is late every run.
How
git revertof #7265, no conflicts: the learned start latency (capped at 0.1 s) returns, the hidden pre-roll and its steering go.Numbers
Rig: screen buffers and system audio of the running browser, 321 s source of ten takes, a 3-frame magenta start and a 20 ms click at each of 50 cues, a green patch while the player's public time is inside a cue. Picture lag = magenta onset minus the playhead's green onset at each cue, takes 2 to 10 (44 cues per run); + is late. Run medians, runs interleaved, load average 5 to 15 (the Mac was shared).
Chromium differs by one video frame (40 ms) in the other direction, both within one frame. The Simulator runs of the previous release (0.9.19, before #7265 and the echo fix) read +108, -17, +83 ms, so the undone build is a return to that behaviour. The echo fix (#7309) is untouched: extra click onsets stay at 0 of 50 on both sides.
Test plan
packages/core/src/runtimepass on a Linux box.fails without the fix: 11 tests in
media.test.ts(start latency: does not start an upcoming video early before any start is measured, starts an upcoming video early by the start latency measured on earlier ones, caps the learned start delay at 100 ms and 5 more in that block, "starts nothing early while paused, and never a video"),media.preseek.test.ts(lands a video clip's in-point before the cut without playing or seeking it again at activation) andinit.videoPreseek.test.tsfail against main'smedia.ts.