@@ -1187,6 +1187,41 @@ describe("initSandboxRuntimeModular", () => {
11871187 expect ( video . style . visibility ) . toBe ( "visible" ) ;
11881188 } ) ;
11891189
1190+ it ( "keeps a long video starting at zero local to its delayed composition host" , ( ) => {
1191+ const root = document . createElement ( "div" ) ;
1192+ root . setAttribute ( "data-composition-id" , "main" ) ;
1193+ root . setAttribute ( "data-root" , "true" ) ;
1194+ root . setAttribute ( "data-start" , "0" ) ;
1195+ root . setAttribute ( "data-duration" , "120" ) ;
1196+ document . body . appendChild ( root ) ;
1197+
1198+ const host = document . createElement ( "div" ) ;
1199+ host . setAttribute ( "data-composition-id" , "nested-video" ) ;
1200+ host . setAttribute ( "data-composition-file" , "compositions/nested.html" ) ;
1201+ host . setAttribute ( "data-start" , "39.233" ) ;
1202+ host . setAttribute ( "data-duration" , "80" ) ;
1203+ root . appendChild ( host ) ;
1204+
1205+ const video = document . createElement ( "video" ) ;
1206+ video . setAttribute ( "data-start" , "0" ) ;
1207+ video . setAttribute ( "data-duration" , "80" ) ;
1208+ video . load = ( ) => { } ;
1209+ host . appendChild ( video ) ;
1210+
1211+ window . __timelines = {
1212+ main : createMockTimeline ( 120 ) ,
1213+ "nested-video" : createMockTimeline ( 80 ) ,
1214+ } ;
1215+
1216+ initSandboxRuntimeModular ( ) ;
1217+
1218+ expect ( window . __hfResolveMediaStartSeconds ?.( video ) ) . toBeCloseTo ( 39.233 ) ;
1219+ window . __player ?. renderSeek ( 80.4 ) ;
1220+ expect ( video . style . visibility ) . toBe ( "visible" ) ;
1221+ window . __player ?. renderSeek ( 111 ) ;
1222+ expect ( video . style . visibility ) . toBe ( "visible" ) ;
1223+ } ) ;
1224+
11901225 it ( "uses the canonical resolver for reference starts, auto-start media, and inline hosts" , ( ) => {
11911226 const root = document . createElement ( "div" ) ;
11921227 root . setAttribute ( "data-composition-id" , "main" ) ;
0 commit comments