| 116 | } |
| 117 | |
| 118 | function shouldIncludeTimelineNode(tag: ParsedTag, rootCompositionId: string | null): boolean { |
| 119 | const attrs = tag.attrs; |
| 120 | if ( |
| 121 | attrs["data-composition-id"] && |
| 122 | rootCompositionId && |
| 123 | attrs["data-composition-id"] === rootCompositionId |
| 124 | ) { |
| 125 | return false; |
| 126 | } |
| 127 | if ( |
| 128 | tag.tagName === "script" || |
| 129 | tag.tagName === "style" || |
| 130 | tag.tagName === "link" || |
| 131 | tag.tagName === "meta" |
| 132 | ) { |
| 133 | return false; |
| 134 | } |
| 135 | if ((attrs.class || "").split(/\s+/).includes("__preview_render_frame__")) return false; |
| 136 | if (attrs["data-start"] != null) return true; |
| 137 | if (attrs["data-track-index"] != null) return true; |
| 138 | if (attrs["data-composition-src"] != null) return true; |
| 139 | if (attrs["data-composition-id"] != null) return true; |
| 140 | return tag.tagName === "video" || tag.tagName === "audio" || tag.tagName === "img"; |
| 141 | } |
| 142 | |
| 143 | function inferClipDuration(tag: ParsedTag, start: number, maxDuration: number): number | null { |
| 144 | const attrs = tag.attrs; |