Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<!-- DO NOT EDIT! This file and support/settings-multiple.vtt are generated. -->
<!-- See /webvtt/parsing/file-parsing/README.md -->
<meta charset=utf-8>
<title>WebVTT parser test: settings, multiple</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
var t = async_test('settings, multiple');
t.step(function(){
var video = document.createElement('video');
var track = document.createElement('track');
assert_true('src' in track, 'track element not supported');
track.src = 'support/settings-multiple.vtt';
track['default'] = true;
track.kind = 'subtitles';
track.onload = this.step_func(trackLoaded);
track.onerror = this.step_func(trackError);
video.appendChild(track);
document.body.appendChild(video);
});
function trackLoaded(event) {
var track = event.target;
var video = track.parentNode;
var cues = video.textTracks[0].cues;
{
assert_equals(cues.length, 2);
var cue = cues[0];
assert_equals(cue.id, 'id0');
assert_equals(cue.text, 'text0');
assert_equals(cue.align, 'start');
assert_equals(cue.line, 1);
assert_equals(cue.snapToLines, false);
assert_equals(cue.vertical, 'lr');
assert_equals(cue.size, 50);
assert_equals(cue.position, 25);
var cue = cues[1];
assert_equals(cue.id, 'id1');
assert_equals(cue.text, 'text1');
assert_equals(cue.align, 'center');
assert_equals(cue.line, 1);
assert_equals(cue.vertical, 'rl');
assert_equals(cue.size, 0);
assert_equals(cue.position, 100);
}
this.done();
}
function trackError(e) {
assert_unreached('got unexpected error event');
}
</script>