The reason these events are blocked is to avoid any download of data that is not triggered by the user ( read Apple's explanation here ). This means that you need to figure out a way to get the user to start downloading audio data. Make the user interact with the page before the meat of your application is launched. Initialization can be caused by something as simple as a "touchstart" running on document.body , or by a button that the user clicks to launch the application (example: ask the user to click the button that says βstart chatβ). In this event handler, load your audio file into a variable and make it available to the rest of your application. Then in your ajax success handler, reproduce the sound:
HTML
<a id="initbutton">Initialize</a>
Js
var sound; $('#initbutton').one('click',function(ev){ sound = new Audio("http://soundjax.com/reddo/61767^ding.mp3"); sound.load();
See an example here. Try initializing the audio first, then run the ajax loop and vice versa. It will be silent until the sound is loaded.
This has been tested in iOS 5.1 on the iPad 2 and iPhone 4S. I do not know if it will work on other devices or in the old version of iOS.
I do not know any other ways to make it work.
source share