diff --git a/packages/core/src/runtime/init.ts b/packages/core/src/runtime/init.ts index 76e01cecb4..f078b86008 100644 --- a/packages/core/src/runtime/init.ts +++ b/packages/core/src/runtime/init.ts @@ -932,6 +932,15 @@ export function initSandboxRuntimeModular(): void { if (typeof state.capturedTimeline.timeScale === "function") { state.capturedTimeline.timeScale(state.playbackRate); } + const boundDuration = getSafeTimelineDurationSeconds(state.capturedTimeline, 0); + if (boundDuration > 0) { + try { + clock.setDuration(boundDuration); + } catch { + // clock not yet initialized — duration will be set during TransportClock setup + } + state.capturedTimeline.pause(); + } if (resolution.diagnostics) { postRuntimeMessage({ source: "hf-preview",