tor-browser

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

test_MediaSource_hevc_mp4.html (1232B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <title>MSE: HEVC playback test</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 <script class="testbody" type="text/javascript">
     11 
     12 SimpleTest.waitForExplicitFinish();
     13 
     14 runWithMSE(async (ms, el) => {
     15  el.controls = true;
     16  await once(ms, "sourceopen");
     17  ok(true, "Receive a sourceopen event");
     18  is(ms.readyState, "open", "MediaSource must be in open state after sourceopen");
     19 
     20  let sb;
     21  try {
     22    sb = ms.addSourceBuffer('video/mp4; codecs="hev1.1.6.L93.B0"');
     23  }
     24  catch (err) {
     25    is(err.name, "NotSupportedError", "Should only receive NotSupportedError");
     26    ok(SpecialPowers.Services.appinfo.OS != "WINNT" &&
     27       SpecialPowers.Services.appinfo.OS != "Darwin" &&
     28       SpecialPowers.Services.appinfo.OS != "Android",
     29      "HEVC is not supported on current platform");
     30    SimpleTest.finish();
     31    return;
     32  }
     33  ok(sb, "Created a SourceBuffer");
     34 
     35  await fetchAndLoad(sb, "hevc_white_frame", [""], ".mp4");
     36  el.play();
     37  ms.endOfStream();
     38  await once(el, "ended");
     39  SimpleTest.finish();
     40 });
     41 
     42 </script>
     43 </body>
     44 </html>