test_aspectratio_mp4.html (1394B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=975978 5 --> 6 7 <head> 8 <title>Media test: default video size</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=975978">Mozilla Bug 975978</a> 14 15 <pre id="test"> 16 <script class="testbody" type="text/javascript"> 17 18 SimpleTest.waitForExplicitFinish(); 19 20 // MP4 video with display size is difference to decode frame size. 21 // The display size is recorded in TrackHeaderBox 'tkhd' of this mp4 video. 22 var resource = 23 { name:"pixel_aspect_ratio.mp4", type:"video/mp4", width:525, height:288 }; 24 25 var v = document.createElement("video"); 26 v.onloadedmetadata = function() { 27 is(v.videoWidth, resource.width, "Intrinsic width should match video width"); 28 is(v.videoHeight, resource.height, "Intrinsic height should match video height"); 29 SimpleTest.finish(); 30 } 31 v.addEventListener("error", function() { 32 if (v.readyState < v.HAVE_METADATA) { 33 info("Video element returns with readyState " + v.readyState + " error.code " + v.error.code); 34 todo(false, "This platform doesn't support to retrieve MP4 metadata."); 35 SimpleTest.finish(); 36 } 37 }); 38 39 v.src = resource.name; 40 v.preload = "auto"; 41 42 document.body.appendChild(v); 43 </script> 44 </pre> 45 </body> 46 </html>