Skip to content

Write HTML. Render video. Built for agents.

fix(studio): restore root-id resolution comment in __timelines path

Miguel Ángel10af9655f207
diff --git a/packages/studio/src/player/hooks/useTimelinePlayer.ts b/packages/studio/src/player/hooks/useTimelinePlayer.ts
index 5ab8b87e77..4614b39361 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");