blob: a1b54e113a120db877660f9f3817e59e9bbcfaca [file] [log] [blame]
<html>
<head>
<title>media-source-wait-canplaythrough-event</title>
<script src="../video-test.js"></script>
<script>
var source;
var sourceBufferVideo;
function runTest() {
findMediaElement();
source = new MediaSource();
waitForEvent('sourceopen', sourceOpen, false, false, source);
video.src = URL.createObjectURL(source);
}
async function sourceOpen() {
sourceBufferVideo = source.addSourceBuffer('video/mp4; codecs="avc1.4d401f"');
waitForEventAndEnd('canplaythrough', null);
sourceBufferVideo.appendBuffer(await (await fetch("content/test-red-3s-480x360.mp4")).arrayBuffer());
failTestIn(2000);
}
</script>
</head>
<body onload="runTest()">
<video></video>
</body>
</html>