mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-04 07:19:52 +00:00
feat: make creator media edits render-safe (#3322)
* feat: make creator media edits render-safe * fix: align media playback timing * docs: add creator editing recipes * docs: expand creator editing guidance * fix: unify media source offsets * fix: scale natural media duration * fix: preserve natural media zero spans * fix: align compiled natural media timing * test: classify compiler media test as integration * fix: drop inactive media windows * fix: unify literal timing parsing * fix: keep browser media parsing serializable * fix: keep page timing readers strict * fix: close remaining preview timing gaps * fix(core): preserve Studio voice pitch at playback speed * chore: keep creator contract source-neutral
This commit is contained in:
@@ -110,6 +110,30 @@ describe("initSandboxRuntimeModular", () => {
|
||||
window.cancelAnimationFrame = (() => {}) as typeof window.cancelAnimationFrame;
|
||||
});
|
||||
|
||||
it.each([
|
||||
["2x", 5],
|
||||
["0x2", 10],
|
||||
])("derives a native-parsed natural media window for rate %s", (rate, expected) => {
|
||||
document.body.innerHTML = `<div data-composition-id="main" data-root="true"><video data-start="0" data-playback-rate="${rate}"></video></div>`;
|
||||
const video = document.querySelector("video")!;
|
||||
Object.defineProperty(video, "duration", { value: 10, configurable: true });
|
||||
window.__timelines = {};
|
||||
initSandboxRuntimeModular();
|
||||
expect(window.__player?.getDuration()).toBe(expected);
|
||||
});
|
||||
|
||||
it.each([10, 11])(
|
||||
"preserves a known zero natural media window at source EOF (start=%s)",
|
||||
(start) => {
|
||||
document.body.innerHTML = `<div data-composition-id="main" data-root="true"><video data-start="0" data-media-start="${start}"></video></div>`;
|
||||
const video = document.querySelector("video")!;
|
||||
Object.defineProperty(video, "duration", { value: 10, configurable: true });
|
||||
window.__timelines = {};
|
||||
initSandboxRuntimeModular();
|
||||
expect(window.__player?.getDuration()).toBe(0);
|
||||
},
|
||||
);
|
||||
|
||||
afterEach(() => {
|
||||
window.__hfRuntimeTeardown?.();
|
||||
document.body.innerHTML = "";
|
||||
|
||||
Reference in New Issue
Block a user