mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-07 10:06:21 +00:00
fix(video): hold final frame through composition
This commit is contained in:
@@ -12,11 +12,39 @@ describe("compileHtml", () => {
|
||||
expect(compiled).toContain('data-end="4"');
|
||||
});
|
||||
|
||||
it("still clamps non-looping media durations to source duration", async () => {
|
||||
it("preserves an explicit non-looping video slot past source end", async () => {
|
||||
const html = '<video id="hero" src="hero.webm" data-start="0" data-duration="4" data-end="4">';
|
||||
|
||||
const compiled = await compileHtml(html, "/project", async () => 3.125);
|
||||
|
||||
expect(compiled).toContain('data-duration="4"');
|
||||
expect(compiled).toContain('data-end="4"');
|
||||
});
|
||||
|
||||
it("uses natural duration for a video without an explicit slot inside a composition", async () => {
|
||||
const html =
|
||||
'<div data-composition-id="root" data-start="0" data-duration="5">' +
|
||||
'<video id="hero" src="hero.webm" data-start="0">' +
|
||||
"</div>";
|
||||
|
||||
const compiled = await compileHtml(html, "/project", async () => 1);
|
||||
|
||||
expect(compiled).toContain('data-duration="1"');
|
||||
expect(compiled).toContain('data-end="1"');
|
||||
});
|
||||
|
||||
it("uses natural duration for a standalone video without a composition window", async () => {
|
||||
const html = '<video id="hero" src="hero.webm" data-start="0">';
|
||||
const compiled = await compileHtml(html, "/project", async () => 1);
|
||||
expect(compiled).toContain('data-duration="1"');
|
||||
expect(compiled).toContain('data-end="1"');
|
||||
});
|
||||
|
||||
it("still clamps non-looping audio durations to source duration", async () => {
|
||||
const html = '<audio id="voice" src="voice.wav" data-start="0" data-duration="4" data-end="4">';
|
||||
|
||||
const compiled = await compileHtml(html, "/project", async () => 3.125);
|
||||
|
||||
expect(compiled).toContain('data-duration="3.125"');
|
||||
expect(compiled).toContain('data-end="3.125"');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user