Skip to content

Write HTML. Render video. Built for agents.

fix(producer): propagate data-start to inner composition element during compilation (#73)

Miguel Ángele5547106464a
diff --git a/packages/producer/src/services/htmlCompiler.ts b/packages/producer/src/services/htmlCompiler.ts
index cbe5e59a69..c517cfb25c 100644
--- a/packages/producer/src/services/htmlCompiler.ts
+++ b/packages/producer/src/services/htmlCompiler.ts
@@ -580,6 +580,16 @@ function inlineSubCompositions(
host.removeAttribute("data-composition-src");
+ // Propagate data-start from the host element to the inserted inner composition
+ // node so runtime timeline nesting resolves the correct start offset.
+ const hostDataStart = host.getAttribute("data-start");
+ if (hostDataStart != null) {
+ const innerComp = host.querySelector("[data-composition-id]");
+ if (innerComp && !innerComp.getAttribute("data-start")) {
+ innerComp.setAttribute("data-start", hostDataStart);
+ }
+ }
+
// Set explicit pixel dimensions on the host element so children using
// width/height: 100% resolve correctly. The runtime does this
// automatically but compiled HTML needs it inline.