(element: HTMLVideoElement | HTMLAudioElement)
| 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") || |
no test coverage detected