MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / durationFromTimeline

Function durationFromTimeline

packages/core/src/runtime/clipTree.ts:59–67  ·  view source on GitHub ↗
(
  el: Element,
  registry: Record<string, RuntimeTimelineLike | undefined>,
)

Source from the content-addressed store, hash-verified

57}
58
59function durationFromTimeline(
60 el: Element,
61 registry: Record<string, RuntimeTimelineLike | undefined>,
62): number | null {
63 const compId = el.getAttribute("data-composition-id");
64 if (!compId) return null;
65 const d = Number(registry[compId]?.duration?.());
66 return Number.isFinite(d) && d > 0 ? d : null;
67}
68
69function durationFromMedia(el: Element): number | null {
70 if (!(el instanceof HTMLMediaElement) || !Number.isFinite(el.duration)) return null;

Callers 1

resolveDurationFunction · 0.85

Calls 2

getAttributeMethod · 0.65
durationMethod · 0.65

Tested by

no test coverage detected