OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body onload="start()"> |
| 4 <p>Load a video with an infinite duration. Start playback and ensure |
| 5 video.currentTime < video.buffered.end(0) upon first timeupdate.</p> |
| 6 <video></video> |
| 7 <script src="video-test.js"></script> |
| 8 <script src="media-file.js"></script> |
| 9 <script> |
| 10 waitForEventOnce('timeupdate', function() { |
| 11 video.pause(); |
| 12 |
| 13 testExpected('video.duration', Infinity, '=='); |
| 14 testExpected('video.buffered.start(0)', 0, '>='); |
| 15 |
| 16 // 10 seconds chosen arbitrarily as it's larger than the duration, but |
| 17 // small enough to test for overflow of arithmetic performed on the |
| 18 // infinite duration. |
| 19 testExpected('video.buffered.end(0)', 10, '<'); |
| 20 test('video.currentTime <= video.buffered.end(0)'); |
| 21 endTest(); |
| 22 }); |
| 23 |
| 24 waitForEventOnce('loadeddata', function() { |
| 25 testExpected('video.buffered.length', 1, '=='); |
| 26 testExpected('video.buffered.start(0)', 0, '>='); |
| 27 testExpected('video.buffered.end(0)', Infinity, '!='); |
| 28 testExpected('video.currentTime', 0, '=='); |
| 29 testExpected('video.duration', Infinity, '=='); |
| 30 video.play(); |
| 31 }); |
| 32 |
| 33 function start() { |
| 34 video.src = 'resources/test-live.webm'; |
| 35 } |
| 36 </script> |
| 37 </body> |
| 38 </html> |
OLD | NEW |