Other Projects

Browser test for media types

Using the modernizer script I’m testing media capabilities in the browser with the following script:

	<!--
          Video Test with Modernizr and diveintohtml5.org/detect.html-->
	<script type="text/javascript" src="tools/getscript.php?modernizr&jqueryui"></script>

<script  type="text/javascript">

		$(function() {
			var videotest = {
				webM : false,
				ogg : false,
				h264 : false,
			}
			if (Modernizr.video) {
				if (Modernizr.video.webm) {
					videotest.webM = true;
				} else if (Modernizr.video.ogg) {
					videotest.ogg = true;
				} else if (Modernizr.video.h264){
					videotest.h264 = true;
				}
			}

			var videoResult = 	"WebM : " + videotest.webM +
						"<br/> OGG  : " + videotest.ogg +
						"
 h264 : " + videotest.h264;

			$('span#videoResultsSpan').html(videoResult);

			if (console) { console.log(videoResult) }

		});
	</script>

Chrome 8.0.552.237:

WebM : true
OGG : false
h264 : false

Firefox Beta 4.0b9:

WebM : true
OGG : false
h264 : false

IE 7.0.6002 and 8.0.7006

WebM : false
OGG : false
h264 : false