blob: 8023c8a6552b8b6bd77d68693a53e1b26503bade [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>&lt;video&gt; element intrinsic size test</title>
<script src=video-test.js></script>
<script>
var movieInfo =
{
current:0,
movies:
[
{
url:"content/scaled-matrix.mov",
description:"saved with a non identity matrix",
width:640,
height:480
},
{
url:"content/720x576i-anamorphic.mov",
description:"encoded with PAL non-square pixels, clean aperture corrects pixel aspect ratio when displayed",
width:1024,
height:576
},
]
};
function testSize()
{
var movie = movieInfo.movies[movieInfo.current];
testExpected("video.videoWidth", movie.width);
testExpected("video.videoHeight", movie.height);
movieInfo.current++;
openNextMovie();
}
function openNextMovie()
{
consoleWrite("");
if (movieInfo.current >= movieInfo.movies.length)
{
endTest();
return;
}
var url = movieInfo.movies[movieInfo.current].url;
video.src = url;
var desc = "<b>Loading</b> <em>\""+ url + "\"</em>" +
". Movie " + movieInfo.movies[movieInfo.current].description + ".</em>";
consoleWrite(desc);
if (movieInfo.current > 0)
video.load();
}
function start()
{
findMediaElement();
waitForEvent("error");
waitForEvent("loadstart");
waitForEvent("waiting");
waitForEvent("ratechange");
waitForEvent("durationchange");
waitForEvent("pause");
waitForEvent("play");
waitForEvent("playing");
waitForEvent('loadedmetadata', testSize);
consoleWrite("<b>Test size before movie is open:</b>");
testExpected("video.videoWidth", 0, "==");
testExpected("video.videoHeight", 0, "==");
openNextMovie();
}
</script>
</head>
<body onload="start()">
<video controls></video>
</body>
</html>