Files
hyperframes/packages
Miguel Ángel 7b6c87fa88 fix(core): account for playbackRate in media duration resolution (#1287)
* fix(core): account for playbackRate in media duration resolution

resolveDurationSeconds computed sourceDuration as (element.duration - mediaStart)
without dividing by playbackRate. A 5s source at 0.5x should span 10s on the
timeline, but was capped at 5s — causing the video to go black once the raw
source was exhausted.

Read defaultPlaybackRate from the element (same clamping as refreshRuntimeMediaCache)
and divide sourceDuration by it so the effective timeline window matches the
actual playback speed.

* test(core): add regression test for playbackRate in resolveDurationSeconds

Pins the fix: a 5s source at 0.5x playbackRate must resolve to 10s effective
duration when resolveDurationSeconds is provided (mirroring the init.ts callback
pattern). Without the rate division, this would return 5s and clip early.
2026-06-08 21:17:41 -04:00
..
2026-06-08 20:47:43 +00:00
2026-06-08 20:47:43 +00:00
2026-06-08 20:47:43 +00:00
2026-06-08 20:47:43 +00:00
2026-06-08 20:47:43 +00:00
2026-06-08 20:47:43 +00:00
2026-06-08 20:47:43 +00:00