tor-browser

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

test_SeekTwice_mp4.html (1468B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>MSE: basic functionality</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  el.controls = true;
     17  await once(ms, "sourceopen");
     18  ok(true, "Receive a sourceopen event");
     19  const audiosb = ms.addSourceBuffer("audio/mp4");
     20  const videosb = ms.addSourceBuffer("video/mp4");
     21  await fetchAndLoad(audiosb, "bipbop/bipbop_audio", ["init"], ".mp4");
     22  await fetchAndLoad(audiosb, "bipbop/bipbop_audio", range(1, 5), ".m4s");
     23  await fetchAndLoad(audiosb, "bipbop/bipbop_audio", range(6, 12), ".m4s");
     24  await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4");
     25  await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 6), ".m4s");
     26  await fetchAndLoad(videosb, "bipbop/bipbop_video", range(7, 14), ".m4s");
     27  let p = once(el, "seeking");
     28  el.play();
     29  el.currentTime = 4.5; // Seek to a gap in the video
     30  await p;
     31  ok(true, "Got seeking event");
     32  p = once(el, "seeked");
     33  el.currentTime = 6; // Seek past the gap.
     34  await p;
     35  ok(true, "Got seeked event");
     36  ok(el.currentTime >= 6, "Time >= 6");
     37  ms.endOfStream();
     38  await once(el, "ended");
     39  SimpleTest.finish();
     40 });
     41 
     42 </script>
     43 </pre>
     44 </body>
     45 </html>