mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
fix: activate nested child timelines during renderSeek
The renderSeek override in init.ts called seekTimelineAndAdapters() which only did rootTimeline.totalTime(t) without activating child timelines. GSAP does not propagate totalTime() to internally paused children. Also simplifies pollSubCompositionTimelines to always call rebind when timelines are ready, removing the before/after count comparison that could skip the rebind on fast page loads.
This commit is contained in:
@@ -365,14 +365,15 @@ async function pollSubCompositionTimelines(
|
||||
}
|
||||
return true;
|
||||
})()`;
|
||||
const timelinesBeforePoll = Number(
|
||||
await page.evaluate(`Object.keys(window.__timelines || {}).length`),
|
||||
);
|
||||
const ready = await pollPageExpression(page, expression, timeoutMs, intervalMs);
|
||||
const timelinesAfterPoll = Number(
|
||||
await page.evaluate(`Object.keys(window.__timelines || {}).length`),
|
||||
);
|
||||
if (ready && timelinesAfterPoll > timelinesBeforePoll) {
|
||||
// Always force a timeline rebind once sub-composition timelines are
|
||||
// confirmed present. The previous implementation only called rebind
|
||||
// when the timeline count grew during the poll, which missed the case
|
||||
// where all sub-comp scripts had already executed before the poll
|
||||
// started — leaving child timelines un-nested in the root and causing
|
||||
// the earliest sub-composition (data-start near 0) to render without
|
||||
// its GSAP animations.
|
||||
if (ready) {
|
||||
await page.evaluate(`(function() {
|
||||
if (typeof window.__hfForceTimelineRebind === "function") {
|
||||
window.__hfForceTimelineRebind();
|
||||
|
||||
Reference in New Issue
Block a user