| OLD | NEW |
| (Empty) |
| 1 <html lang="en"> | |
| 2 <head> | |
| 3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| 4 <title><video> element intrinsic size test</title> | |
| 5 <script src=video-test.js></script> | |
| 6 | |
| 7 <script> | |
| 8 | |
| 9 var movieInfo = | |
| 10 { | |
| 11 current:0, | |
| 12 movies: | |
| 13 [ | |
| 14 { | |
| 15 url:"content/scaled-matrix.mov", | |
| 16 description:"saved with a non identity matrix", | |
| 17 width:640, | |
| 18 height:480 | |
| 19 }, | |
| 20 { | |
| 21 url:"content/720x576i-anamorphic.mov", | |
| 22 description:"encoded with PAL non-square pixels, clean a
perture corrects pixel aspect ratio when displayed", | |
| 23 width:1024, | |
| 24 height:576 | |
| 25 }, | |
| 26 ] | |
| 27 }; | |
| 28 | |
| 29 function testSize() | |
| 30 { | |
| 31 var movie = movieInfo.movies[movieInfo.current]; | |
| 32 | |
| 33 testExpected("video.videoWidth", movie.width); | |
| 34 testExpected("video.videoHeight", movie.height); | |
| 35 | |
| 36 movieInfo.current++; | |
| 37 openNextMovie(); | |
| 38 } | |
| 39 | |
| 40 function openNextMovie() | |
| 41 { | |
| 42 consoleWrite(""); | |
| 43 if (movieInfo.current >= movieInfo.movies.length) | |
| 44 { | |
| 45 endTest(); | |
| 46 return; | |
| 47 } | |
| 48 | |
| 49 var url = movieInfo.movies[movieInfo.current].url; | |
| 50 video.src = url; | |
| 51 var desc = "<b>Loading</b> <em>\""+ url + "\"</em>" + | |
| 52 ". Movie " + movieInfo.movies[movieInfo.current].des
cription + ".</em>"; | |
| 53 consoleWrite(desc); | |
| 54 if (movieInfo.current > 0) | |
| 55 video.load(); | |
| 56 } | |
| 57 | |
| 58 function start() | |
| 59 { | |
| 60 findMediaElement(); | |
| 61 | |
| 62 waitForEvent("error"); | |
| 63 waitForEvent("loadstart"); | |
| 64 waitForEvent("waiting"); | |
| 65 waitForEvent("ratechange"); | |
| 66 waitForEvent("durationchange"); | |
| 67 waitForEvent("pause"); | |
| 68 waitForEvent("play"); | |
| 69 waitForEvent("playing"); | |
| 70 | |
| 71 waitForEvent('loadedmetadata', testSize); | |
| 72 | |
| 73 consoleWrite("<b>Test size before movie is open:</b>"); | |
| 74 testExpected("video.videoWidth", 0, "=="); | |
| 75 testExpected("video.videoHeight", 0, "=="); | |
| 76 | |
| 77 openNextMovie(); | |
| 78 } | |
| 79 </script> | |
| 80 </head> | |
| 81 | |
| 82 <body onload="start()"> | |
| 83 | |
| 84 <video controls></video> | |
| 85 | |
| 86 </body> | |
| 87 </html> | |
| OLD | NEW |