user1581579
user1581579

Reputation: 341

Audio - Chrome Mobile - Android

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

Answers (2)

Kinlan
Kinlan

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

Lpc_dark
Lpc_dark

Reputation: 2940

Yes only Mozilla I believe really support that format on mobile

Upvotes: 0

Related Questions