summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-disabled.html
blob: d517b9d12c7bdd130fc49f04f1c628f2e70abbe4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<title>Disabling a track</title>
<script src="/common/media.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<video>
    <track kind="subtitles" src="resources/captions.vtt"/>
</video>
<script>
async_test(function(t) {
    var video = document.querySelector("video");
    video.textTracks[0].mode = "disabled";

    // Waiting for the duration of the first cue to elapse.
    video.ontimeupdate = t.step_func(function (event) {
        if (event.target.currentTime < 1)
            return;

        // End test after the duration of the first cue to make sure
        // the test would have gone through the period where this cue
        // would have been rendered if the track was not disabled.
        t.done();
    });

    video.src = getVideoURI("/media/test");
    video.play();
});
</script>