jungle out there, but HTML5 features are in most cases well documented. A lot of good tutorials are for example on html5rocks.com • On mobile devices, some things are a lot different compared to your desktop browser • So these are just some tips and tricks for web developers, who want to deploy their (multimedia) web-apps on different browsers • Three topics: Animation, Orientation and Audio
Animations (with jQuery or consorts), but DOM manipulation always costs on mobile devices • iOS5 devices handle them quite well, but you can feel the difference to the desktop browser even there. • So, whenever possible, use CSS3 Transitions or Animations instead of DOM Manipulation
@media only screen and (orientation: landscape) window.onorientationchange = function() { var orientation = window.orientation; // orientation in degrees switch(orientation) { case 0: //iOS portrait ... break; case 90: //iOS landscape ... break; case -90: ... break; } } In CSS you have Media Queries to check your screen size and orientation In Javascript, just listen on the onorientationchange Event
// do portrait stuff } else { // do landscape stuff } }) Drawback: Is not implemented on all systems (iOS4, Android 2.3) So in worst case, you have to rely on UA sniffing (urks) or some dirty, dirty tricks
Audio is still at an early stage, and we're not talking about the usual format debate • Implementations are very unreliable as of now. This is still one of the main reasons for developers to switch back to Flash fallbacks • e.g. cuttherope.ie. They created some sort of debate with their decision • But we know, Flash fallbacks are not even an option at all ...
calls if a user interaction happened, or if the file already has been downloaded completely iOS devices (and most mobile webkit browsers, like Android) only allow playing sound directly after a user interaction. So
one sound file containing all sound effects back to back. • Define start and ending time of each entry in your sound sprite • Give the user some sort of starting point where he can load the sound file for the first time, e.g. "START APP" - Button