Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/media-elements/track/track-element/track-disabled.html - WPT Dashboard Interop Dashboard
<!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>