mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-10 22:20:14 +00:00
fix(core): extend media start fix to all consumers, guard auto-start
Narrow the raw data-start read to media elements without data-hf-auto-start (explicitly authored global coordinates). Elements with auto-injected data-start="0" remain composition-local via the resolver. Apply consistently across all three consumers: - visibility loop (init.ts) - refreshRuntimeMediaCache start/duration (init.ts) - resolveMediaWindowEndSeconds (timeline.ts) Add regression test for auto-injected data-start="0" inside a late-starting host to prove it doesn't regress.
This commit is contained in:
@@ -220,7 +220,9 @@ export function collectRuntimeTimelinePayload(params: {
|
||||
if (mediaNodes.length === 0) return null;
|
||||
let maxWindowEndSeconds = 0;
|
||||
for (const mediaNode of mediaNodes) {
|
||||
const start = startResolver.resolveStartForElement(mediaNode, 0);
|
||||
const start = !mediaNode.hasAttribute("data-hf-auto-start")
|
||||
? Math.max(0, Number(mediaNode.getAttribute("data-start") ?? 0) || 0)
|
||||
: startResolver.resolveStartForElement(mediaNode, 0);
|
||||
if (!Number.isFinite(start)) continue;
|
||||
const duration = resolveMediaElementDurationSeconds(mediaNode);
|
||||
if (duration == null || duration <= 0) continue;
|
||||
|
||||
Reference in New Issue
Block a user