fix(producer): use composition metadata for video period detection

Replaces GSAP visibility probe with composition.videos array for
determining which time ranges have active video. The GSAP probe
missed subcomposition videos entirely — hf-video-0 was detected as
26-42s when it's actually 0-49.8s.

composition.videos has reliable start/end from data-start/data-end
attributes, including all subcomposition videos.
This commit is contained in:
Miguel Ángel
2026-04-27 10:10:31 -04:00
parent bfd3b06967
commit e87f5a6af9
@@ -1909,12 +1909,24 @@ export async function executeRenderJob(
// ── Adaptive state capture ──────────────────────────────────────
// pixel-perfect: per-frame CDP during video periods, sparse otherwise
// fast (default): sparse states + baked video overlay
const videoRanges = videoOverlays.map((v) => ({
start: v.dataStart,
end: v.dataEnd,
//
// Use composition.videos (ALL videos including subcompositions) for
// video period detection — more reliable than GSAP visibility probe
// which can miss subcomposition videos.
const videoRanges = composition.videos.map((v) => ({
id: v.id,
start: v.start,
end: v.end,
}));
const isInVideoRange = (t: number) => videoRanges.some((r) => t >= r.start && t < r.end);
if (pixelPerfectMode) {
log.info("Video ranges from composition metadata", {
count: videoRanges.length,
ranges: videoRanges.map((r) => `${r.id}[${r.start.toFixed(1)}-${r.end.toFixed(1)}]`),
});
}
const stateTimes: number[] = [];
if (pixelPerfectMode) {