
iPad and onReady to start audio file
I keep seeing that it's not possible to autoplay an audio file on the iPad. What's strange is that the following code works on SOME iPads, but not all:
function loadPlayer(file)
{
jwplayer("mediaplayer").setup({
flashplayer: "js/jwplayer.flash-6.5.swf",
html5player: "js/jwplayer.html5-6.5.js",
file: "assets/audio/"+file,
controls: true,
width: 100,
height: 50,
events: {
onComplete: function() {
pageCompleted();
}
}
});
jwplayer("mediaplayer").onReady(function(event) {
jwplayer("mediaplayer").play();
});
}
//this is called after other stuff happens (loading XML, etc)
loadPlayer(file);
Can you 100% confirm that the above code should not be possible? And can you explain why it would work on some iPads and not others? There is no commonality amongst them that I can find -- I've duplicated settings, etc. It works on some iPad 2s, and not others.