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:
Miguel Ángel
2026-03-30 22:22:34 +02:00
parent 7bc8d3ff66
commit 4d5b4976ef
@@ -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}`;
});