4 <title>Test behavior when seeking to the duration and the playback rate equals
0.
</title>
5 <script src=
"media-file.js"></script>
6 <script src=
"video-test.js"></script>
12 video
.src
= findMediaFile("video", "content/test");
14 waitForEvent("seeking");
16 waitForEventOnce("loadedmetadata", function()
18 consoleWrite("Seeking to duration");
19 video
.currentTime
= video
.duration
;
20 video
.playbackRate
= 0;
21 waitForEventOnce("seeked");
22 waitForEventOnce("ended", firstEnded
);
27 testExpected("video.currentTime == video.duration", true);
28 consoleWrite("Seeking to the middle of the video");
29 video
.currentTime
= video
.duration
/ 2;
30 waitForEventOnce("seeked", seekToMiddleDone
);
33 function seekToMiddleDone()
35 consoleWrite("Setting loop to true and seeking to duration.");
37 video
.currentTime
= video
.duration
;
38 waitForEventOnce("seeked", seekToDurationComplete
);
41 function seekToDurationComplete()
43 consoleWrite("Seek to duration completed. Waiting for a seek to the beginning.");
44 waitForEventOnce("seeked", seekToBeginningComplete
);
47 function seekToBeginningComplete()
49 testExpected("video.currentTime", 0);
55 <body onload=
"onLoad()">
56 <video id=
"v" preload=
"metadata"></video>