4 <title>Media test: seek test
1</title>
5 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
6 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
7 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
12 onended='return playbackEnded();'
13 onloadedmetadata='return startTest();'
14 onseeking='return seekStarted();'
15 onseeked='return seekEnded();'
></video>
17 <script class=
"testbody" type=
"text/javascript">
18 var startPassed = false;
19 var endPassed = false;
20 var seekFlagStart = false;
21 var seekFlagEnd = false;
23 var completed = false;
25 var v = document.getElementById('v');
26 ok(!v.seeking,
"seeking should default to false");
34 ok(readonly,
"seeking should be readonly");
36 function startTest() {
39 var v = document.getElementById('v');
45 function seekStarted() {
49 var v = document.getElementById('v');
52 seekFlagStart = v.seeking;
56 function seekEnded() {
60 var v = document.getElementById('v');
61 var t = v.currentTime;
62 ok(t
>=
2 && t <=
3,
"Video currentTime should be around 2: " + t);
65 seekFlagEnd = v.seeking;
69 function playbackEnded() {
74 ok(startPassed,
"seeking event");
75 ok(endPassed,
"seeked event");
76 ok(seekFlagStart,
"seeking flag on start should be true");
77 ok(!seekFlagEnd,
"seeking flag on end should be false");
82 SimpleTest.waitForExplicitFinish();