diff --git a/packages/studio/src/player/hooks/useTimelinePlayer.ts b/packages/studio/src/player/hooks/useTimelinePlayer.ts index 5ab8b87e7..4614b3936 100644 --- a/packages/studio/src/player/hooks/useTimelinePlayer.ts +++ b/packages/studio/src/player/hooks/useTimelinePlayer.ts @@ -134,6 +134,10 @@ export function useTimelinePlayer() { if (win.__timelines) { const keys = Object.keys(win.__timelines); if (keys.length > 0) { + // Resolve the root composition id from the DOM — the outermost + // `[data-composition-id]` element is the master. Without this, + // Object.keys() order would let a sub-composition's timeline + // hijack play/pause/seek and the duration readout. const rootId = iframe?.contentDocument ?.querySelector("[data-composition-id]") ?.getAttribute("data-composition-id");