I cannot seem to get audio media to play in Mobile Safari on iOS 4.2.1 in any situation other than the handler of a click event performed by the user. Even then, if player.play()
is called in any asynchronous fashion (ajax, setTimeout
, etc) it doesn't work.
I've tried calling player.load()
before player.play()
. I've tried triggering a click event on a dom element whose handler calls player.play()
. I've tried using both audio and video tags.
All the loopholes that worked prior to iOS 4.2.1 seem to be closed. Any ideas?
play()
function within an asynchronous function (Ajax call). Even in a click handler, with an actual click, it still didn't work. So: beware, I guess. I wish Apple would publish the specific criteria we need to follow. – JKS