OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="/w3c/resources/testharness.js"></script> |
| 5 <script src="/w3c/resources/testharnessreport.js"></script> |
| 6 <script src="mediasource-util.js"></script> |
| 7 <link rel='stylesheet' href='/w3c/resources/testharness.css'> |
| 8 </head> |
| 9 <body> |
| 10 <div id="log"></div> |
| 11 <script> |
| 12 mediasource_test(function(test, mediaElement, mediaSource) |
| 13 { |
| 14 test.failOnEvent(mediaElement, 'error'); |
| 15 test.endOnEvent(mediaElement, 'ended'); |
| 16 |
| 17 var mediaType = 'video/webm;codecs="vp8,vorbis"'; |
| 18 var mediaURL = '/media/resources/media-source/webm/test.webm'; |
| 19 var sourceBuffer = mediaSource.addSourceBuffer(mediaType); |
| 20 |
| 21 MediaSourceUtil.loadBinaryData(test, mediaURL, function(data) |
| 22 { |
| 23 sourceBuffer.addEventListener('updateend', test.step_func(func
tion() |
| 24 { |
| 25 mediaSource.duration = 1; |
| 26 mediaSource.endOfStream(); |
| 27 mediaElement.play(); |
| 28 })); |
| 29 sourceBuffer.appendBuffer(data); |
| 30 }); |
| 31 }, "Test normal playback case with MediaSource API"); |
| 32 </script> |
| 33 </body> |
| 34 </html> |
OLD | NEW |