OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body onload="load()"> | 3 <body onload="load()"> |
4 <p>Tests decoding and rendering a video element that has a changing reso
lution.</p> | 4 <p>Tests decoding and rendering a video element that has a changing reso
lution.</p> |
5 <video width=320></video> | 5 <video width=320></video> |
6 <video width=320></video> | 6 <video width=320></video> |
7 <script> | 7 <script> |
8 if (window.testRunner) { | 8 if (window.testRunner) { |
9 testRunner.waitUntilDone(); | 9 testRunner.waitUntilDone(); |
10 } | 10 } |
11 | 11 |
12 function load() { | 12 function load() { |
13 var canplayCount = 0; | 13 var canplayCount = 0; |
14 function oncanplay() { | 14 function oncanplay() { |
15 if (++canplayCount < 2) { | 15 if (++canplayCount < 2) { |
16 return; | 16 return; |
17 } | 17 } |
18 // Make sure we render the first frame. | 18 // Make sure we render the first frame. |
19 if (window.testRunner) { | 19 requestAnimationFrame(function() { |
20 testRunner.display(); | 20 video.play(); |
21 } | 21 }); |
22 video.play(); | |
23 }; | 22 }; |
24 | 23 |
25 // Get the first video to stay on frame zero for comparison purp
oses. | 24 // Get the first video to stay on frame zero for comparison purp
oses. |
26 var video = document.getElementsByTagName("video")[0]; | 25 var video = document.getElementsByTagName("video")[0]; |
27 video.src = "../media/resources/frame_size_change.webm"; | 26 video.src = "../media/resources/frame_size_change.webm"; |
28 video.addEventListener('canplay', oncanplay); | 27 video.addEventListener('canplay', oncanplay); |
29 | 28 |
30 // Get the second video to play through the clip with changing d
imensions. | 29 // Get the second video to play through the clip with changing d
imensions. |
31 video = document.getElementsByTagName("video")[1]; | 30 video = document.getElementsByTagName("video")[1]; |
32 video.src = "../media/resources/frame_size_change.webm"; | 31 video.src = "../media/resources/frame_size_change.webm"; |
(...skipping 15 matching lines...) Expand all Loading... |
48 testRunner.notifyDone(); | 47 testRunner.notifyDone(); |
49 } | 48 } |
50 }); | 49 }); |
51 | 50 |
52 video.currentTime = 0.5; | 51 video.currentTime = 0.5; |
53 }); | 52 }); |
54 } | 53 } |
55 </script> | 54 </script> |
56 </body> | 55 </body> |
57 </html> | 56 </html> |
OLD | NEW |