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.
Entries (RSS)