Skip to content

Commit 7afc1c4

Browse files
committed
fix(cli): surface video frame-injection failures in snapshot output
1 parent 1d2aca6 commit 7afc1c4

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

‎packages/cli/src/commands/snapshot.ts‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,13 @@ async function captureSnapshots(
320320
syncVideoFrameVisibility = engine.syncVideoFrameVisibility;
321321
extractMediaMetadata = engine.extractMediaMetadata;
322322
} catch {
323-
// Engine unavailable in this install — snapshot will still run, and
324-
// compositions without <video data-start> get exactly the old behaviour.
323+
// Engine unavailable in this install — snapshot still runs, but any
324+
// <video data-start> will screenshot black (chrome-headless ignores
325+
// programmatic currentTime writes). Say so instead of silently
326+
// shipping black frames (two wild Windows reports).
327+
console.warn(
328+
` ${c.warn("⚠")} @hyperframes/engine unavailable — <video> elements will appear black in snapshots. Verify media via a draft render's extracted frames instead.`,
329+
);
325330
}
326331
const alphaDecoderCache = new Map<string, Promise<boolean>>();
327332
const shouldUseVp9AlphaDecoder = (filePath: string): Promise<boolean> => {
@@ -426,6 +431,13 @@ async function captureSnapshots(
426431
});
427432
}
428433

434+
if (active.length > 0 && updates.length < active.length) {
435+
const missed = active.length - updates.length;
436+
console.warn(
437+
` ${c.warn("⚠")} ${missed}/${active.length} active <video> frame(s) could not be extracted at ${time.toFixed(1)}s — those videos will appear black/stale in this snapshot`,
438+
);
439+
}
440+
429441
// Sync visibility even when empty — clears stale overlays from prior seeks
430442
try {
431443
if (updates.length > 0) {
@@ -436,7 +448,9 @@ async function captureSnapshots(
436448
active.map((a) => a.id),
437449
);
438450
} catch {
439-
/* fall through to plain screenshot */
451+
console.warn(
452+
` ${c.warn("⚠")} video frame injection failed at ${time.toFixed(1)}s — <video> elements will appear black/stale in this snapshot`,
453+
);
440454
}
441455
}
442456

0 commit comments

Comments
 (0)