tor-browser

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

track-disabled.html (886B)


      1 <!DOCTYPE html>
      2 <title>Disabling a track</title>
      3 <script src="/common/media.js"></script>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <video>
      7    <track kind="subtitles" src="resources/captions.vtt"/>
      8 </video>
      9 <script>
     10 async_test(function(t) {
     11    var video = document.querySelector("video");
     12    video.textTracks[0].mode = "disabled";
     13 
     14    // Waiting for the duration of the first cue to elapse.
     15    video.ontimeupdate = t.step_func(function (event) {
     16        if (event.target.currentTime < 1)
     17            return;
     18 
     19        // End test after the duration of the first cue to make sure
     20        // the test would have gone through the period where this cue
     21        // would have been rendered if the track was not disabled.
     22        t.done();
     23    });
     24 
     25    video.src = getVideoURI("/media/test");
     26    video.play();
     27 });
     28 </script>