CarlRyds
CarlRyds

Reputation: 217

Website HTML 5 Audio Autoplay

I have an intranet thats basically a web page on the amazon fire browser, and i want an audio file to autoplay when the page loads...

<audio controls autoplay>
 <source src="alarm.ogg" type="audio/ogg">
 <source src="alarm.mp3" type="audio/mpeg">
 Your browser does not support the audio element.
</audio>

This works fine on the desktop browsers, Chrome, Safari, etc. However, on the fire tablet (and my iPhone) the audio element is there but you have to press play, it doesn't autoplay.

Any ideas how to make this work?

Thanks

Upvotes: 1

Views: 1170

Answers (1)

thangngoc89
thangngoc89

Reputation: 1400

From howler.js documentation:

By default, audio on iOS, Android, etc is locked until a sound is played within a user interaction, and then it plays normally the rest of the page session (Apple documentation). The default behavior of howler.js is to attempt to silently unlock audio playback by playing an empty buffer on the first touchend event.

Upvotes: 2

Related Questions