mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
fix: regression fixes — conditional rebind + updated compilation baselines
1. Only call __hfForceTimelineRebind() when the timeline poll actually had to wait (pollDuration > 2 intervals). For compositions with synchronous timeline registration, the rebind was unnecessary and shifted render timing, causing PSNR regressions in chat and gsap-letters-render-compat. 2. Regenerate compiled.html baselines for missing-host-comp-id and overlay-montage-prod to match the new flattenInnerRoot behavior (data-composition-id stripped from inlined inner roots, replaced with data-hf-authored-id). 3. Add late-bind polling to runtime init.ts — after external compositions load, poll for 5s to detect async timelines that register after initial binding (e.g. from fetch callbacks).
This commit is contained in:
@@ -1469,6 +1469,33 @@ export function initSandboxRuntimeModular(): void {
|
||||
applyCaptionOverrides();
|
||||
postTimeline();
|
||||
postState(true);
|
||||
|
||||
let lateBindChecks = 0;
|
||||
const lateBindInterval = setInterval(() => {
|
||||
if (++lateBindChecks > 50) {
|
||||
clearInterval(lateBindInterval);
|
||||
return;
|
||||
}
|
||||
const hosts = document.querySelectorAll("[data-composition-id]");
|
||||
let allBound = true;
|
||||
for (let i = 0; i < hosts.length; i++) {
|
||||
const id = hosts[i].getAttribute("data-composition-id");
|
||||
if (id && !timelines[id]) {
|
||||
allBound = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (allBound && lateBindChecks > 1) {
|
||||
clearInterval(lateBindInterval);
|
||||
return;
|
||||
}
|
||||
if (!allBound) return;
|
||||
childrenBound = false;
|
||||
bindRootTimelineIfAvailable();
|
||||
postTimeline();
|
||||
postState(true);
|
||||
clearInterval(lateBindInterval);
|
||||
}, 100);
|
||||
});
|
||||
} else {
|
||||
// No external/inline compositions to load — apply caption overrides immediately
|
||||
|
||||
Reference in New Issue
Block a user