mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-01 19:42:03 +00:00
fix(core): set __renderReady unconditionally after binding attempt
The capturedTimeline guard broke CSS/WAAPI/Lottie compositions that have no GSAP timeline — __renderReady was never set, causing the parity harness to timeout after 30s. renderSeek works with or without a GSAP timeline (adapter-only seeking), so the correct invariant is "timeline binding was attempted" not "a timeline was found." Set __renderReady unconditionally in all three paths, after bindRootTimelineIfAvailable has run.
This commit is contained in:
@@ -557,7 +557,7 @@ describe("initSandboxRuntimeModular", () => {
|
||||
expect(window.__player).toBeDefined();
|
||||
});
|
||||
|
||||
it("does not set __renderReady when no timeline is available", () => {
|
||||
it("sets __renderReady even without a GSAP timeline (CSS/WAAPI compositions)", () => {
|
||||
const root = document.createElement("div");
|
||||
root.setAttribute("data-composition-id", "main");
|
||||
root.setAttribute("data-root", "true");
|
||||
@@ -571,6 +571,6 @@ describe("initSandboxRuntimeModular", () => {
|
||||
initSandboxRuntimeModular();
|
||||
|
||||
expect(window.__playerReady).toBe(true);
|
||||
expect(window.__renderReady).toBeUndefined();
|
||||
expect(window.__renderReady).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1460,9 +1460,7 @@ export function initSandboxRuntimeModular(): void {
|
||||
.finally(() => {
|
||||
externalCompositionsReady = true;
|
||||
bindRootTimelineIfAvailable();
|
||||
if (state.capturedTimeline) {
|
||||
window.__renderReady = true;
|
||||
}
|
||||
window.__renderReady = true;
|
||||
runAdapters("discover", state.currentTime);
|
||||
bindMediaMetadataListeners();
|
||||
installAssetFailureDiagnostics();
|
||||
@@ -1633,11 +1631,11 @@ export function initSandboxRuntimeModular(): void {
|
||||
player._timeline = state.capturedTimeline;
|
||||
}
|
||||
|
||||
// __renderReady = timeline is bound, safe for deterministic seeking.
|
||||
// __renderReady = timeline binding attempted, safe for deterministic seeking.
|
||||
// Set unconditionally: renderSeek works with or without a GSAP timeline
|
||||
// (CSS/WAAPI/Lottie compositions use adapter-only seeking).
|
||||
// fileServer.ts sets this immediately (no timeline to bind in its runtime).
|
||||
if (state.capturedTimeline) {
|
||||
window.__renderReady = true;
|
||||
}
|
||||
window.__renderReady = true;
|
||||
|
||||
// When the bundler inlines compositions, data-composition-src is removed so
|
||||
// loadExternalCompositions() is skipped. But inline scripts registering child
|
||||
@@ -1650,9 +1648,7 @@ export function initSandboxRuntimeModular(): void {
|
||||
player._timeline = state.capturedTimeline;
|
||||
}
|
||||
runAdapters("discover", state.currentTime);
|
||||
if (state.capturedTimeline) {
|
||||
window.__renderReady = true;
|
||||
}
|
||||
window.__renderReady = true;
|
||||
postTimeline();
|
||||
postState(true);
|
||||
}, 0);
|
||||
|
||||
Reference in New Issue
Block a user