2008-10-23 01:02:18 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Media test: timeupdate and size</title>
|
2009-05-06 13:46:04 -07:00
|
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
2008-10-23 01:02:18 -07: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 if the media size during the first timeupdate is correct.
|
|
|
|
var completed = false;
|
|
|
|
var seeking = false;
|
|
|
|
|
|
|
|
function startTest() {
|
|
|
|
if (completed)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
var v = document.getElementById('v');
|
|
|
|
v.currentTime=2.0;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
function startSeek() {
|
|
|
|
if (completed)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
seeking = true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
function timeUpdated() {
|
|
|
|
if (completed || !seeking)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
var v = document.getElementById('v');
|
|
|
|
ok(v.currentTime >= 1.8 && v.currentTime <= 2.2,
|
|
|
|
"Check currentTime of " + v.currentTime + " is within range in timeupdate after seek");
|
|
|
|
completed = true;
|
|
|
|
v.pause();
|
|
|
|
SimpleTest.finish();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
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();'
|
|
|
|
onseeking='return startSeek();'
|
|
|
|
ontimeupdate='return timeUpdated();'></video>
|
2008-10-23 01:02:18 -07:00
|
|
|
</body>
|
|
|
|
</html>
|