blob: feaf0b7b89024398e70745433be16a4868a3088d [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src=../../media-resources/video-test.js></script>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function start() {
video = document.getElementById('video');
video.src = "../resources/hls/test-webvtt-flashing.m3u8";
video.play();
waitForEventOnceOn(video.textTracks, 'addtrack', trackAdded);
}
function trackAdded() {
testExpected("video.textTracks.length", "1");
run("video.textTracks[0].mode = 'showing'");
waitForEventOnceOn(video.textTracks[0], 'cuechange', cueChanged);
}
function cueChanged() {
testExpected("video.textTracks[0].activeCues.length", "1");
testExpected("video.textTracks[0].activeCues[0].text", "Subtitle Test");
testExpected("video.textTracks[0].activeCues[0].endTime", "0.100", ">");
endTest();
}
</script>
</head>
<body onload="start()">
<video id="video" muted loop></video>
</body>
</html>