tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_AVC3_mp4.html (1052B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>MSE: AVC3 content playback.</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 
     15 runWithMSE(async (ms, el) => {
     16  await once(ms, "sourceopen");
     17  ok(true, "Receive a sourceopen event");
     18  const videosb = ms.addSourceBuffer("video/mp4");
     19 
     20  await fetchAndLoad(videosb, "avc3/init", [""], ".mp4");
     21  const p = once(el, "loadeddata");
     22  await fetchAndLoad(videosb, "avc3/segment", range(1, 2), ".m4s");
     23  await p;
     24  is(videosb.buffered.length, 1, "continuous buffered range");
     25  ok(true, "got loadeddata");
     26  ms.endOfStream();
     27  await once(ms, "sourceended");
     28  ok(true, "endOfStream completed");
     29  // Now ensure that we can play to the end.
     30  el.play();
     31  await once(el, "ended");
     32  SimpleTest.finish();
     33 });
     34 
     35 </script>
     36 </pre>
     37 </body>
     38 </html>