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

Function getTimelineDurationSeconds

packages/core/src/runtime/init.ts:572–581  ·  view source on GitHub ↗
(timeline: RuntimeTimelineLike | null)

Source from the content-addressed store, hash-verified

570 let externalCompositionsReady = !hasExternalCompositions && !hasInlineTemplateCompositions;
571
572 const getTimelineDurationSeconds = (timeline: RuntimeTimelineLike | null): number | null => {
573 if (!timeline || typeof timeline.duration !== "function") return null;
574 try {
575 const raw = Number(timeline.duration());
576 if (!Number.isFinite(raw)) return null;
577 return Math.max(0, raw);
578 } catch {
579 return null;
580 }
581 };
582
583 const isUsableTimelineDuration = (durationSeconds: number | null): durationSeconds is number =>
584 typeof durationSeconds === "number" &&

Calls 1

durationMethod · 0.65

Tested by

no test coverage detected