

#Html5 audio ipad download#
Possible solution for that: Have a splash screen in your app, that the user has to remove, and that triggers the download of your soundfile. After that, you can do all the cool audio things you want to do.īut why do you need user interaction to play audio (and video)? Isn't that unusual? Might be, but imagine yourself with your iPhone in a roaming region, having limited bandwidth, trying to reach your favourite website which just came up with some nifty 10MB background song not only trying to ruin your nerves, but also adding some more bucks on your phone bill for next month. Once an interaction is done, the file is downloaded to your device. This can be the built-in Audio player controls (which seem to be not compliant to Apples user interface standards by being flipping small), or any click or touch eventhandler bound to your elements. Each sound playing requires a user interaction, their "OK" or their "Go for it" by touching an element on your page.

The most important rule of all: Do not think that you just can play sound by using JS events, like you're used to when working with Desktop browsers.

#1 - One does not simply play sound on JS event And if you know the rules, you know why all tests fail and how you can deal with that. HTML5 Audio is pretty f***ed up on iOS too, but it works. But why? Is HTML5 Audio compatibility really that bad on iPad and iPhone, especially when it's the only way to include sound?
#Html5 audio ipad android#
If you run through some tests and view the browser compatibilty list, you will see that many tests fail on mobile browsers like early Android implementations and especially on iOS devices. This is not only the recommended way of building websites and web-apps, but even more a mindset or way of thinking: Ask your browser what it can do (do a test), and you know what you can use, absolutely independent of browser vendors and versions.įor such a complex feature like HTML5 Audio, it's great that with areweplayingyet there is a community out there which supplies such tests for HTML5 Audio subfeatures, API calls and best practices like hot swapping audio sources. With Modernizr we made a huge step away from applying features by browser detection towards feature detection. This article is a follow-up to my talk at the Barcamp in Salzburg in March and was inspired by Chris Heilmans tweets on that topic a few days ago.įirst of all: We all know Modernizr, we all use it and we all love it. But you haven't experienced true pain and suffering until you try to get HTML5 audio done on mobile devices. HTML5 Audio on desktop browsers is a mess.
