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-cue-inline.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Add a track and change its mode through JS</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<video>
<source src="/media/test.mp4" type="video/mp4">
<source src="/media/test.webm" type="video/webm">
</video>
<script>
test(function() {
var video = document.querySelector('video');
var track = video.addTextTrack('captions', 'English', 'en');
track.addCue(new VTTCue(0.0, 10.0, 'wow wow'));
track.mode = 'showing';
});
</script>