Reputation:
Problem with the audio on Android (HTML5/Javascript program in the native web browser). Works fine on desktop Chrome and iPad Safari. However on Android native browser the audio plays once and then will not play again if called.
Audio is initialised by the user tapping on an image which calls a routine :
function init_audio() { //User audio loading
for (i=0; i<num_audio; i++){
audio[i].load();}
localStorage[8] = "true"; //Local flag to indicate done
}
Whenever required, the audio call is simply:
audio[i].play();
If there was any errors with normal loading and playing, then I'm not sure why it would work at all. Every audio clip loaded will play once each, then not again.
Upvotes: 0
Views: 78
Reputation: 3149
In order to invoke your media player again, first you have to "clear" (release) it.
Try this before your "audio[i].play();"
if (audio[i] != null) if(audio[i].isPlaying()) audio[i].stop();
audio[i].release();
Upvotes: 1