Skip to content

fix(runtime): size a clip from data-end when it has no data-duration#1578

Open
calcarazgre646 wants to merge 1 commit into
heygen-com:mainfrom
calcarazgre646:fix/timeline-clip-data-end
Open

fix(runtime): size a clip from data-end when it has no data-duration#1578
calcarazgre646 wants to merge 1 commit into
heygen-com:mainfrom
calcarazgre646:fix/timeline-clip-data-end

Conversation

@calcarazgre646

Copy link
Copy Markdown
Contributor

Problem

collectRuntimeTimelinePayload's clip loop (timeline.ts) resolved a clip's duration from data-duration, then fell straight through to the inherited (composition) duration when it was absent. So a clip authored with data-start + data-end but no data-duration (a valid, compiler-emitted shape that the linter only warns about) was sized start..compositionEnd instead of start..end. A data-start="2" data-end="8" clip under a 20s composition rendered as an 18s bar (20 - 2) on the Studio timeline instead of 6s, overrunning every later clip on its track.

The scene loop (same file) and startResolver.resolveDurationForElement already read data-end; the clip loop was the sibling that did not.

Change

Read data-end as the duration source between data-duration and the inherited fallback, mirroring the scene loop (Math.max(0, end - start)). No change for clips that carry data-duration.

Tests

A clip with data-start="2" data-end="8" and no data-duration under a 20s composition now reports duration 6, not 18. Verified load-bearing (reverting the fix produces 18). Full core suite green.

The timeline clip loop read only data-duration, then fell through to the
inherited (composition) duration when it was absent. A clip authored with
data-start/data-end but no data-duration (a valid, compiler-emitted shape
the linter only warns about) was sized start..compositionEnd instead of
start..end: a 2s..8s clip under a 20s composition rendered as an ~18s bar
overrunning every later clip on its track.

Read data-end as the duration source before the inherited fallback,
mirroring the scene loop and resolveDurationForElement which already do.
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.

1 participant