| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body onload="load()"> | |
| 4 <p>Tests decoding and rendering a video element that has a changing reso
lution.</p> | |
| 5 <video width=320></video> | |
| 6 <video width=320></video> | |
| 7 <script> | |
| 8 if (window.testRunner) { | |
| 9 testRunner.waitUntilDone(); | |
| 10 } | |
| 11 | |
| 12 function load() { | |
| 13 var canplayCount = 0; | |
| 14 function oncanplay() { | |
| 15 if (++canplayCount < 2) { | |
| 16 return; | |
| 17 } | |
| 18 // Make sure we render the first frame. | |
| 19 if (window.testRunner) { | |
| 20 testRunner.display(); | |
| 21 } | |
| 22 video.play(); | |
| 23 }; | |
| 24 | |
| 25 // Get the first video to stay on frame zero for comparison purp
oses. | |
| 26 var video = document.getElementsByTagName("video")[0]; | |
| 27 video.src = "../media/resources/frame_size_change.webm"; | |
| 28 video.addEventListener('canplay', oncanplay); | |
| 29 | |
| 30 // Get the second video to play through the clip with changing d
imensions. | |
| 31 video = document.getElementsByTagName("video")[1]; | |
| 32 video.src = "../media/resources/frame_size_change.webm"; | |
| 33 video.addEventListener('canplay', oncanplay); | |
| 34 | |
| 35 video.addEventListener('playing', function() { | |
| 36 // Make sure the video plays for a bit. | |
| 37 video.addEventListener('timeupdate', function() { | |
| 38 if (video.currentTime > 1.0) { | |
| 39 video.pause(); | |
| 40 } | |
| 41 }); | |
| 42 }); | |
| 43 | |
| 44 video.addEventListener('pause', function() { | |
| 45 // Now seek back to a point where resolution should be diffe
rent. | |
| 46 video.addEventListener('seeked', function() { | |
| 47 if (window.testRunner) { | |
| 48 testRunner.notifyDone(); | |
| 49 } | |
| 50 }); | |
| 51 | |
| 52 video.currentTime = 0.5; | |
| 53 }); | |
| 54 } | |
| 55 </script> | |
| 56 </body> | |
| 57 </html> | |
| OLD | NEW |