4 <p>Tests decoding and rendering a video element that has a changing resolution.
</p>
5 <video width=
320></video>
6 <video width=
320></video>
8 if (window
.testRunner
) {
9 testRunner
.waitUntilDone();
14 function oncanplay() {
15 if (++canplayCount
< 2) {
18 // Make sure we render the first frame.
19 requestAnimationFrame(function() {
24 // Get the first video to stay on frame zero for comparison purposes.
25 var video
= document
.getElementsByTagName("video")[0];
26 video
.src
= "../media/resources/frame_size_change.webm";
27 video
.addEventListener('canplay', oncanplay
);
29 // Get the second video to play through the clip with changing dimensions.
30 video
= document
.getElementsByTagName("video")[1];
31 video
.src
= "../media/resources/frame_size_change.webm";
32 video
.addEventListener('canplay', oncanplay
);
34 video
.addEventListener('playing', function() {
35 // Make sure the video plays for a bit.
36 video
.addEventListener('timeupdate', function() {
37 if (video
.currentTime
> 1.0) {
43 video
.addEventListener('pause', function() {
44 // Now seek back to a point where resolution should be different.
45 video
.addEventListener('seeked', function() {
46 if (window
.testRunner
) {
47 testRunner
.notifyDone();
51 video
.currentTime
= 0.5;