Skip to content

fix(engine): hold last frame for non-looping videos past source end#1044

Closed
miguel-heygen wants to merge 3 commits into
mainfrom
fix/video-hold-last-frame-past-source-end
Closed

fix(engine): hold last frame for non-looping videos past source end#1044
miguel-heygen wants to merge 3 commits into
mainfrom
fix/video-hold-last-frame-past-source-end

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

Summary

  • When a video source is shorter than data-duration without loop, the renderer output black frames after the source ended while preview held the last frame correctly
  • Root cause: getFrameAtTime() and getActiveFramePayloads() only returned the last frame for looping videos; non-looping videos returned null, so the frame injector skipped them and headless Chrome rendered black
  • Fix: remove the loop guard so all videos hold their last extracted frame when seeking past source duration, matching native browser behavior

Test plan

  • Updated existing test to verify non-looping clips hold last frame (was asserting the buggy behavior)
  • All 618 engine tests pass
  • Build passes (tsc + lint + format)

Closes #1043

When a <video> source is shorter than data-duration without loop,
getFrameAtTime() and getActiveFramePayloads() returned null for
frames past the source end — the frame injector skipped the element
and headless Chrome rendered black. Browser preview holds the last
frame natively (per HTML spec), creating a preview/render divergence.

Remove the loop guard so both looping and non-looping videos return
the last extracted frame when seeking past the source duration.

Closes #1043
Add getFrameAtTime regression test covering source shorter than
data-duration: verifies last frame is returned (not null) when
seeking past source end for non-looping videos.

Strengthens the FrameLookupTable test to check at both 1.5s and
4.9s (near timeline end) to guard against future regressions.
Adds a producer regression test with a 2s source video and 4s
data-duration (no loop). Validates that the rendered output holds
the last frame instead of going black after the source ends.

Baseline generated inside Docker (Dockerfile.test) — 100 visual
checkpoints and audio comparison all pass.
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.

fix: non-looping video renders black frames when source is shorter than data-duration

1 participant