3 <script src=
"../../../LayoutTests/media/video-test.js"></script>
9 function trySeek(seekTo
)
11 if (isInTimeRanges(video
.seekable
, seekTo
)) {
12 if (isInTimeRanges(video
.buffered
, seekTo
)) {
13 consoleWrite("Warining: Seeking into buffered region. May not generate waiting or seeking events.");
15 run("video.currentTime = " + seekTo
);
17 failTest("Cannot seek to " + seekTo
+ ". Does engine support seeking into unbuffered region?");
27 function scheduleSeek() {
28 setTimeout(someTimeLater
, 200);
31 function someTimeLater()
33 consoleWrite("Running scheduled seek");
34 testExpected("seekedCount", counter
);
35 testExpected("video.currentTime", counter
, ">=");
55 waitForEvent('waiting');
56 waitForEvent('seeking');
57 waitForEvent('seeked', seeked
);
58 waitForEvent('play', someTimeLater
);
60 consoleWrite("Start Load");
61 video
.src
= "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=../../../media/content/test.mp4&throttle=25";
67 <body onload=
"start()">
68 <video controls
></video>
70 <p>Attempt to seek out of the buffered range. If supported, this
71 should cause a waiting and seeking event to be fired for each seek.
72 This test makes assumptions on the size of the input file, the bitrate
73 of delivery, and the duration of the file.
76 Source is assumed to be about
188k with a uniform bitrate,
> 4
77 seconds in length, and served at
25kb/s. This should make seeking one
78 second ahead every
200ms always leave the buffered region.