tor-browser

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

track-webvtt-two-cue-layout-after-first-end.html (872B)


      1 <!DOCTYPE html>
      2 <html class="reftest-wait">
      3 <title>WebVTT two-cue layout after the first cue has ended</title>
      4 <link rel="match" href="track-webvtt-two-cue-layout-after-first-end-ref.html">
      5 <script src="/common/reftest-wait.js"></script>
      6 <video style="border:1px solid gray">
      7  <source src="/media/white.webm" type="video/webm">
      8  <source src="/media/white.mp4" type="video/mp4">
      9 </video>
     10 <script>
     11 // Add two cues, where the first cue ends before the second.
     12 var video = document.querySelector("video");
     13 var track = video.addTextTrack("captions");
     14 let cue1 = new VTTCue(-1, 1, "cue 1");
     15 track.addCue(cue1);
     16 // As video's duration is 10s, it ensures that this cue would always be displayed.
     17 track.addCue(new VTTCue(0, 10, "cue 2"));
     18 track.mode = "showing";
     19 video.play();
     20 cue1.onexit = () => {
     21  cue1.onexit = null;
     22  video.pause();
     23  takeScreenshot();
     24 };
     25 </script>
     26 </html>