mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-20 12:25:51 +00:00
fix(engine): union video selectors to restore backward compat with regression tests
The video[src][data-start] selector excluded production compositions whose video elements have id+src but no data-start, breaking all visual frames while audio passed. Now unions both selectors so videos are discovered if they match either video[id][src] (original) or video[src][data-start] (sub-composition without explicit id).
This commit is contained in:
@@ -52,7 +52,14 @@ export function parseVideoElements(html: string): VideoElement[] {
|
||||
const videos: VideoElement[] = [];
|
||||
const { document } = parseHTML(html);
|
||||
|
||||
const videoEls = Array.from(document.querySelectorAll("video[src][data-start]"));
|
||||
// Union: original "video[id][src]" (backward compat) + "video[src][data-start]"
|
||||
// (sub-composition videos that have timing but no explicit id).
|
||||
const videoEls = Array.from(
|
||||
new Set([
|
||||
...Array.from(document.querySelectorAll("video[id][src]")),
|
||||
...Array.from(document.querySelectorAll("video[src][data-start]")),
|
||||
]),
|
||||
);
|
||||
videoEls.forEach((el, i) => {
|
||||
if (!el.id) el.id = `hf-video-${i}`;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user