mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-05 00:56:23 +00:00
The studio player's RAF loop in useTimelinePlayer notified the playhead position via liveTime.notify(time) before checking the duration limit. When adapter.getTime() returned a value past the composition's data-duration (due to timing drift or delayed duration calculation), the playhead would visually overshoot — showing e.g. 0:19 on a 0:10 composition. The web player component already had this clamping (playback-state.ts line 42, direct-timeline-clock.ts line 56), but the studio player's forward loop was missing it. Fix: clamp time to dur before notifying, matching the pattern already used in the web player: Math.min(rawTime, dur) when dur > 0.