| <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> |