2008-11-09 17:38:02 -08:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Media test: seek test 1</title>
|
2009-05-06 13:46:04 -07:00
|
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
2008-11-09 17:38:02 -08:00
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
// Test that getting the duration from a file works
|
|
|
|
var completed = false;
|
|
|
|
var timeout;
|
|
|
|
|
|
|
|
function startTest() {
|
|
|
|
if (completed)
|
|
|
|
return false;
|
|
|
|
var v = document.getElementById('v');
|
2009-05-28 21:13:23 -07:00
|
|
|
is(Math.round(v.duration*1000), 3966, "Check duration of video: " + v.duration);
|
2008-11-09 17:38:02 -08:00
|
|
|
completed = true;
|
|
|
|
clearTimeout(timeout);
|
|
|
|
SimpleTest.finish();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
timeout = setTimeout(function () {
|
|
|
|
ok(false, "Test timed out");
|
|
|
|
SimpleTest.finish();
|
|
|
|
}, 60000);
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
</script>
|
|
|
|
</pre>
|
2009-01-05 17:18:40 -08:00
|
|
|
<video id='v'
|
2009-01-16 01:07:26 -08:00
|
|
|
src='seek.ogv'
|
2009-01-05 17:18:40 -08:00
|
|
|
onloadedmetadata='return startTest();'></video>
|
2008-11-09 17:38:02 -08:00
|
|
|
</body>
|
|
|
|
</html>
|