4 <title>Media test: ended and replaying
</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 onloadedmetadata='return startTest();'
13 onplay='return playbackStarted();'
14 onended='return playbackEnded();'
></video>
16 <script class=
"testbody" type=
"text/javascript">
17 // Test if video can be replayed after ended.
18 var v = document.getElementById('v');
19 var completed = false;
22 function startTest() {
30 function playbackStarted() {
37 function playbackEnded() {
41 ok(v.currentTime
>=
3.9 && v.currentTime <=
4.0,
42 "Checking currentTime at end: " + v.currentTime);
43 ok(v.ended,
"Checking playback has ended");
48 ok(playCount ==
2,
"Check playback after ended event");
55 SimpleTest.waitForExplicitFinish();