blob: 692d0a3a933bb8997ba816c683755d074e68a15e [file] [log] [blame]
<video controls></video>
<p>Test that a waiting event is sent when media loading stalls after having sent 'canplay'.</p>
<script src=../../media-resources/media-file.js></script>
<script src=../../media-resources/video-test.js></script>
<script>
var timeupdateCount = 0;
waitForEvent('durationchange');
waitForEvent('loadedmetadata');
waitForEvent('loadeddata');
waitForEventAndEnd('waiting');
waitForEvent('canplay', function () {
run("video.play()");
} );
mediaElement.addEventListener('timeupdate', function () {
// 'timeupdate' events are also fired as playback progresses so only verify that at least one
// event is fired.
if (++timeupdateCount == 1)
consoleWrite("EVENT(timeupdate)");
} );
// Find a supported media file.
var mediaFile = findMediaFile("video", "../../../../media/content/long-test");
var mimeType = mimeTypeForFile(mediaFile);
video.src = "http://127.0.0.1:8000/media/resources/serve-video.php?name=" + mediaFile + "&type=" + mimeType + "&stallOffset=100000&stallDuration=60&chunkSize=1024";
</script>