After chatting with my mate Mike about my previous investigations into HTML5, he responded with:

"This, IS what is going to suck about HTML 5.0. You know this is going to cause compatibility hacks to make things work for your video tags, or you are going to keep using flash or silverlight (probably flash)."

For video it’s pretty simple. You can to cater for any browsers you want to support… you have to encode the video multiple times but the browser goes through until it finds one it can handle.

e.g..

<video width="320" height="240">
<source src=".....mp4"...>
<source src=".....ogv"...>
</video>

As far as the other compatibilty issues go, there’s a javascript library called Modernizr that can take care of all that for you.. e.g.

if (Modernizr.video && Modernizr.video.ogg){
// preload ogg video assets
}
else if (Modernizr.video && Modernizr.video.h264){
// preload h264 assets
}

or for Geolocation for example:

if (Modernizr.geolocation){
navigator.geolocation.getCurrentPosition(function(position) {
// pass the lat and long values to an application
// e.g. a setUserLatandLong() function may find the closest bodega
setUserLatandLong(position.coords.latitude,position.coords.longitude);
});
}

It’s all pretty cool. There’s even a JS library out there to help with the IE compatibility (http://code.google.com/p/html5shiv/)..

Better yet, have a read of http://www.diveintohtml5.org/. It should fill in any gaps… ones that can be filled at this stage anyway

As mentioned previously, browser support is a bit iffy, but there are ways to hack them into shape. I’ve heard it suggested that one of the ways of going about it is to code in HTML5 and hack everything else to fit, so that when the browsers catch up you won’t have to work as hard to make it compliant.

One Response to “HTML5 Compatibility Issues”
  1. Mike says:

    Good read!

    I admit I haven’t really looked into the video tags at all on HTML 5 standards, so it was a nice surprise to see that they included the multiple format support. It’s still going to be a painful process to provide files in all those compression standards.
    Video is made so much easier right now by using flash or silverlight plugins, since you provide it in one format, and the user is expected to have the player installed, or they’ll be directed to get it.

    There are some big problems with Silverlight compatibility in browsers other than IE. (For example, look at the Alan Wake site at xbox.com/alanwake, and take a look and the bright falls videos – My chrome browser could not manage to get them to play, so I had to load up IE to get it to work… The videos suck, by the way).

    That’s why HTML 5 video tags should be better. But unless they make it easier for the content provider to distribute video, it’s not the best solution. Selecting a range of video compression standards and having all browsers support them all would be nice… Not holding my breath, though.

    Ah… yeah. Anyway, the Modernizr JS library is the sort of “hack” I was referring to. I would have clarified more if I had more time, but we’re pretty busy at work at the moment. ;-)

    -Mike

  2.  
Leave a Reply