blob: 64e68f3b9c8459940ab143b603961bf816f172eb [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>
function trackLoaded()
{
consoleWrite("EVENT(load) -- &lt;track&gt;");
consoleWrite("<i>**check metadata track state<" + "/i>");
testExpected("track.readyState", HTMLTrackElement.LOADED);
testExpected("track.track.mode", "hidden");
testExpected("video.textTracks[0].cues.length", 12);
testExpected("video.textTracks[0].cues[11].startTime", 22);
consoleWrite("");
endTest();
}
function canplaythrough()
{
consoleWrite("EVENT(canplaythrough) -- &lt;video&gt;");
consoleWrite("<i>**change metadata track mode so it loads<" + "/i>");
testExpected("track.readyState", HTMLTrackElement.NONE);
testExpected("video.textTracks[0].mode", "disabled");
testExpected("video.textTracks[0].cues", null);
run("video.textTracks[0].mode = 'hidden'");
consoleWrite("");
}
function start()
{
consoleWrite("<br>EVENT(load) -- &lt;body&gt;");
findMediaElement();
consoleWrite("<i>**check initial metadata track state<" + "/i>");
track = document.querySelectorAll('track')[0];
testExpected("track.readyState", HTMLTrackElement.NONE);
testExpected("video.textTracks[0].mode", "disabled");
video.src = findMediaFile("video", "../content/test");
consoleWrite("");
}
</script>
</head>
<body onload="start()">
<p>Tests that a 'metadata' track does not load automatically, but does load when the mode is changed.</p>
<video oncanplaythrough="canplaythrough()" >
<track kind="metadata" src="captions-webvtt/metadata.vtt" onload="trackLoaded()">
</video>
</body>
</html>