blob: daa9b4cc8b9773473ec9414eed2be07fb468e389 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src=../media-file.js></script>
<script src=../video-test.js></script>
<script src=../media-controls.js></script>
<script>
var testTrack;
var seekedCount = 0;
var info = [
0.5, "",
1.5, "Lorem ipsum dolor sit amet,",
2.5, "",
3.3, "consectetuer adipiscing elit,",
0.6, "",
5.9, "sed diam nonummy nibh euismod tincidunt",
4.4, "",
7.9, "ut laoreet dolore magna aliquam erat volutpat."
];
function seeked()
{
var time = info[seekedCount];
var cueText = info[seekedCount + 1];
seekedCount += 2;
testExpected("video.currentTime.toFixed(1)", time.toFixed(1));
if (cueText.length)
testExpected("testTrack.track.activeCues[0].text", cueText);
testExpected("textTrackDisplayElement(video, 'display').innerText", cueText);
if (seekedCount >= info.length) {
consoleWrite("");
endTest();
return;
}
consoleWrite("");
run("video.currentTime = " + (info[seekedCount]));
}
function loaded()
{
findMediaElement();
testTrack = document.querySelector('track');
video.src = findMediaFile('video', '../content/counting');
waitForEvent('seeked', seeked);
waitForEvent('canplaythrough', function() { video.currentTime = .5; });
}
setCaptionDisplayMode('Automatic');
</script>
</head>
<body onload="loaded()">
<video controls >
<track src="captions-webvtt/captions-gaps.vtt" kind="captions" default>
</video>
<p>Test that cues are rendered and removed.</p>
</body>
</html>