diff --git a/packages/producer/src/services/renderOrchestrator.test.ts b/packages/producer/src/services/renderOrchestrator.test.ts index 2f5d8cf044..f3eb95841c 100644 --- a/packages/producer/src/services/renderOrchestrator.test.ts +++ b/packages/producer/src/services/renderOrchestrator.test.ts @@ -113,6 +113,44 @@ describe("extractStandaloneEntryFromIndex", () => { expect(extracted).toBeNull(); }); + + it("re-points the wrapper duration at the scene's own, not the master's", () => { + const indexHtml = ` + + +
+
+
+ +`; + const sceneHtml = ``; + + const extracted = extractStandaloneEntryFromIndex( + indexHtml, + "compositions/scene1.html", + sceneHtml, + ); + + // The extracted standalone advertises the scene file's 3s, not the mount's 2s or master's 12s. + expect(extracted).toContain('data-duration="3"'); + expect(extracted).not.toContain('data-duration="12"'); + }); + + it("falls back to the mount's data-duration when the scene file isn't supplied", () => { + const indexHtml = ` + + +
+
+
+ +`; + + const extracted = extractStandaloneEntryFromIndex(indexHtml, "compositions/scene1.html"); + + expect(extracted).toContain('data-duration="2"'); + expect(extracted).not.toContain('data-duration="12"'); + }); }); describe("captureAttemptMadeProgress", () => { diff --git a/packages/producer/src/services/renderOrchestrator.ts b/packages/producer/src/services/renderOrchestrator.ts index 18ccdb5fef..1cc490d87e 100644 --- a/packages/producer/src/services/renderOrchestrator.ts +++ b/packages/producer/src/services/renderOrchestrator.ts @@ -946,7 +946,27 @@ function normalizeCompositionSrcPath(srcPath: string): string { return srcPath.replace(/\\/g, "/").replace(/^\.\//, ""); } -function createStandaloneEntryRenderClone(root: Element, host: Element): Element { +/** + * Read the `data-duration` off a scene file's `