( el: Element, registry: Record<string, RuntimeTimelineLike | undefined>, )
| 57 | } |
| 58 | |
| 59 | function 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 | |
| 69 | function durationFromMedia(el: Element): number | null { |
| 70 | if (!(el instanceof HTMLMediaElement) || !Number.isFinite(el.duration)) return null; |
no test coverage detected