Does it work if you dont try to hide it?
Dec 9, 2020
6
Level 1
Audio tag won't autoplay
I tried many different approaches. And still can't do this.
these are everything that I tried =
<embed src="/mainAssets/christmas/song.mp3" type="audio/mp3" autostart="true" hidden="true">
<audio
id="player"
autoplay controls>
<source src="/mainAssets/christmas/song.mp3" type="audio/mp3">
</audio>
<audio
onload="play()"
controls
autoplay
id="myAudio"
src="/mainAssets/christmas/song.mp3">
Your browser does not support the
<code>audio</code> element.
</audio>
<iframe src="/mainAssets/christmas/song.mp3" type="audio/mp3" allow="autoplay" id="audio" ></iframe>
<audio autoplay controls>
<source src="/mainAssets/christmas/song.mp3" type="audio/mp3">
</audio>
The audio control is working, it just the autoplay won't work as supposed to be. The main goal is to do display:none of audio and make it autoplay each time the page is loaded.
How to make the mp3 is autoplay as the background music of our website?
please help.
Please or to participate in this conversation.