blob: 71cdcdfbebe543f5d881e8a2540854ba65e0fd62 [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 cueDisplayElement;
var retries = 0;
var maxRetries = 256;
function testPosition()
{
if (!window.internals) {
consoleWrite("<br><b>** This test only works in DRT! **<" + "/b>");
return;
}
// The textTrackDisplayElement call will fail and throw an exception if the text track display element
// has not yet been added to the text track container element. We wait until it has been added.
try {
cueDisplayElement = textTrackDisplayElement(video, 'display', 0);
} catch (exception) {
retries++;
if (retries > maxRetries) {
consoleWrite("The test failed because the text track display element was not found.");
endTest();
}
else
setTimeout(testPosition, 100);
return;
}
consoleWrite("");
document.body.offsetTop;
testExpected("cueDisplayElement.offsetTop > (video.videoHeight * .70)", true);
endTest();
}
function loaded()
{
consoleWrite("The top of the text track container should be in the bottom 30% of the video element.");
findMediaElement();
video.src = findMediaFile('video', '../content/test');
waitForEvent('canplaythrough', testPosition);
}
setCaptionDisplayMode('Automatic');
</script>
</head>
<body onload="loaded()">
<video controls>
<track src="captions-webvtt/captions-snap-to-lines-not-set.vtt" kind="captions" >
<track src="captions-webvtt/simple-captions.vtt" kind="captions" >
<track src="captions-webvtt/sorted-dispatch.vtt" kind="captions" >
<track src="captions-webvtt/captions-fast.vtt" kind="captions" >
<track src="captions-webvtt/captions-html.vtt" kind="captions" >
<track src="captions-webvtt/captions.vtt" kind="captions" default>
</video>
</body>
</html>