I'm trying to play audio using a HTML5 Audio tag on my phone. I've loaded the sound but when I run the .play() command, nothing happens. I made the default controls visible so that I test by pressing that play button and that one works and the sound plays. I've also tried playing the sound by executing the javascript from the address bar and that works aswell.
The code I'm using to play looks something like this:
setInterval(function(){
if(blahblah){
document.getElementById("player").play();
}
},500);
To make sure that it even tries to play the sound, I put an alert after it, like this:
setInterval(function(){
if(blahblah){
document.getElementById("player").play();
alert("Played!");
}
},500);
I saw the alert, but no sound was played.
Thanks for any help :)