test_SplitAppendDelay_mp4.html (1197B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>MSE: append segments with delay</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <script type="text/javascript" src="mediasource.js"></script> 7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 8 </head> 9 <body> 10 <pre id="test"> 11 <script class="testbody" type="text/javascript"> 12 13 SimpleTest.waitForExplicitFinish(); 14 SimpleTest.requestFlakyTimeout("untriaged"); 15 16 runWithMSE(async (ms, v) => { 17 await once(ms, "sourceopen"); 18 const sb = ms.addSourceBuffer("video/mp4"); 19 20 const arrayBuffer = await fetchWithXHR("bipbop/bipbop2s.mp4"); 21 sb.appendBuffer(new Uint8Array(arrayBuffer, 0, 1395)); 22 v.play(); 23 await once(sb, "updateend"); 24 await wait(1000); 25 sb.appendBuffer(new Uint8Array(arrayBuffer, 1395)); 26 await once(sb, "updateend"); 27 ms.endOfStream(); 28 await once(v, "ended"); 29 // The bipbop video doesn't start at 0. The old MSE code adjust the 30 // timestamps and ignore the audio track. The new one doesn't. 31 isfuzzy(v.duration, 1.696, 0.166, "Video has correct duration"); 32 isfuzzy(v.currentTime, 1.696, 0.166, "Video has played to end"); 33 SimpleTest.finish(); 34 }); 35 36 </script> 37 </pre> 38 </body> 39 </html>