3 <title><video
> element size and resize test
</title>
4 <script src=video-test.js
></script>
5 <script src=media-file.js
></script>
16 description
:"no 'src' and no 'poster', with 'width' and 'height' attributes",
25 description
:"no 'src' and no 'poster', with NO 'width' and 'height' attributes, should be default size",
33 poster
:"content/abe.png",
34 description
:"'poster' but no 'src', should be image size",
42 poster
:"content/abe.png",
43 description
:"'poster' and 'src', should be <video> size",
51 poster
:"content/greenbox.png",
52 description
:"'poster' and invalid 'src', should be image size",
61 function setupNextConfiguration()
64 if (movieInfo
.current
>= movieInfo
.movies
.length
)
70 var movie
= movieInfo
.movies
[movieInfo
.current
];
71 if (movie
.src
|| movie
.poster
) {
72 var desc
= "<b>Setting ";
73 if (movie
.src
&& relativeURL(video
.src
) != movie
.src
) {
74 video
.src
= findMediaFile("video", movie
.src
);
75 desc
+= "'src' to <em>\""+ movie
.src
+ ".[extension]\"</em> ";
77 if (movie
.poster
&& relativeURL(video
.poster
) != movie
.poster
) {
78 video
.poster
= movie
.poster
;
79 desc
+= "'poster' to <em>\""+ movie
.poster
+ "\"</em>";
81 consoleWrite(desc
+ "</b>");
84 // Remove width/height attributes if present
85 if (video
.width
|| video
.height
) {
86 consoleWrite("<b>Removing 'width' and 'height' attributes.</b>");
87 video
.removeAttribute('width');
88 video
.removeAttribute('height');
91 if (!movie
.src
|| movie
.src
.indexOf('bogus') >= 0)
92 setTimeout(testMovie
, 100);
97 if (movieInfo
.current
>= movieInfo
.movies
.length
)
100 var temp
= document
.body
.offsetWidth
;
101 var movie
= movieInfo
.movies
[movieInfo
.current
];
103 var desc
= "<b>Testing movie with " + movie
.description
+ ".</b>";
106 testExpected("video.clientWidth", movie
.width
);
107 testExpected("video.clientHeight", movie
.height
);
108 testExpected("video.videoWidth", movie
.videoWidth
);
109 testExpected("video.videoHeight", movie
.videoHeight
);
112 setupNextConfiguration();
123 <body onload=
"setTimeout(test, 100)">
125 <video controls width=
640 height=
480 onloadedmetadata=
"testMovie()"></video>
126 <p>Test
<video
> element size with and without 'src' and 'poster' attributes.
</p>