mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-12 15:20:13 +00:00
fix: offset nested template video timing (#2859)
* fix: offset nested template video timing * test(producer): cover nested sequential video render * fix: share canonical nested media timing
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
formatSnapshotTimestamp,
|
||||
parseZoomScale,
|
||||
requireSnapshotFfmpeg,
|
||||
resolveSnapshotVideoClipStart,
|
||||
resolveSnapshotVideoFrameTime,
|
||||
tailFrameTime,
|
||||
} from "./snapshot.js";
|
||||
@@ -154,6 +155,35 @@ describe("resolveSnapshotVideoFrameTime", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveSnapshotVideoClipStart", () => {
|
||||
it("offsets a scene-local video start by its later template host", () => {
|
||||
expect(
|
||||
resolveSnapshotVideoClipStart({
|
||||
authoredStart: 0,
|
||||
runtimeResolvedStart: 3,
|
||||
}),
|
||||
).toBe(3);
|
||||
});
|
||||
|
||||
it("uses the runtime's recursively resolved start for deeply nested media", () => {
|
||||
expect(
|
||||
resolveSnapshotVideoClipStart({
|
||||
authoredStart: 1,
|
||||
runtimeResolvedStart: 8,
|
||||
}),
|
||||
).toBe(8);
|
||||
});
|
||||
|
||||
it("keeps authored starts as a compatibility fallback", () => {
|
||||
expect(
|
||||
resolveSnapshotVideoClipStart({
|
||||
authoredStart: 3,
|
||||
runtimeResolvedStart: null,
|
||||
}),
|
||||
).toBe(3);
|
||||
});
|
||||
});
|
||||
|
||||
describe("computeSnapshotTimes (FINDING [7]: tail is always captured)", () => {
|
||||
it("default frames: last point is the readable tail, never exact duration", () => {
|
||||
const { times, appendedTail } = computeSnapshotTimes(8, { frames: 5 });
|
||||
|
||||
Reference in New Issue
Block a user