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

Function resolveMediaCompositionContext

packages/core/src/runtime/init.ts:1658–1668  ·  view source on GitHub ↗
(element: HTMLVideoElement | HTMLAudioElement)

Source from the content-addressed store, hash-verified

1656
1657 const syncMediaForCurrentState = () => {
1658 const resolveMediaCompositionContext = (element: HTMLVideoElement | HTMLAudioElement) => {
1659 const compositionRoot = element.closest("[data-composition-id]");
1660 const inheritedStart = compositionRoot ? resolveStartForElement(compositionRoot, 0) : null;
1661 // Media sync follows the authored host window, matching visibility for
1662 // authored composition hosts. Live child timeline duration only fills in
1663 // when no authored timing exists, so seeks clamp against host clip timing.
1664 const inheritedDuration = compositionRoot
1665 ? resolveDurationForElement(compositionRoot, { includeAuthoredTimingAttrs: true })
1666 : null;
1667 return { compositionRoot, inheritedStart, inheritedDuration };
1668 };
1669 const cache = refreshRuntimeMediaCache({
1670 shouldIncludeElement: (element) =>
1671 element.hasAttribute("data-start") ||

Callers 1

syncMediaForCurrentStateFunction · 0.85

Calls 2

resolveStartForElementFunction · 0.85

Tested by

no test coverage detected