mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-04 07:19:52 +00:00
fix(core,cli): address review — guard __renderReady, drop pre-quantization, add tests
- Guard __renderReady with `if (state.capturedTimeline)` in all three paths (setTimeout(0) and .finally() were setting it unconditionally even when bindRootTimelineIfAvailable returned false) - Remove redundant fps=30 pre-quantization in snapshot — renderSeek already calls quantizeTimeToFrame internally with the runtime's canonicalFps, so pre-quantizing was double-quantizing at a potentially wrong grid - Add regression tests: __renderReady is set when timeline exists, stays undefined when no timeline is available
This commit is contained in:
@@ -1463,7 +1463,9 @@ export function initSandboxRuntimeModular(): void {
|
||||
.finally(() => {
|
||||
externalCompositionsReady = true;
|
||||
bindRootTimelineIfAvailable();
|
||||
(window as Window & { __renderReady?: boolean }).__renderReady = true;
|
||||
if (state.capturedTimeline) {
|
||||
(window as Window & { __renderReady?: boolean }).__renderReady = true;
|
||||
}
|
||||
runAdapters("discover", state.currentTime);
|
||||
bindMediaMetadataListeners();
|
||||
installAssetFailureDiagnostics();
|
||||
@@ -1650,9 +1652,10 @@ export function initSandboxRuntimeModular(): void {
|
||||
if (bindRootTimelineIfAvailable() && state.capturedTimeline !== prevTimeline) {
|
||||
player._timeline = state.capturedTimeline;
|
||||
}
|
||||
// Re-run adapters to discover new elements
|
||||
runAdapters("discover", state.currentTime);
|
||||
(window as Window & { __renderReady?: boolean }).__renderReady = true;
|
||||
if (state.capturedTimeline) {
|
||||
(window as Window & { __renderReady?: boolean }).__renderReady = true;
|
||||
}
|
||||
postTimeline();
|
||||
postState(true);
|
||||
}, 0);
|
||||
|
||||
Reference in New Issue
Block a user