Reputation: 341
I cannot play audio with Chrome Mobile on Android. Is it restricted from playing audio (OGG)?
So, I've an HTML document. Inside, is the following audio tag:
<audio id="audiotag1" src="beep.ogg" preload="auto"></audio>
I also trigger the audio to play with JS:
document.getElementById('audiotag1').play();
The audio plays fine in Chrome desktop but doesn't play at all in Chrome Mobile. Are there some restrictions/flags I should know?
Upvotes: 2
Views: 1158
Reputation: 16597
Chrome for Android requires a user-gesture to play the sound audio file. Make sure that your play
invocation is on an event such as click.
Upvotes: 1