How to autoplay audio, when the page is loaded?
I have tried put autoplay in the audio tag, and it didn't work.
<audio id="audio" autoplay>
<source src="audio/dark-tense-piano-drone.mp3" type="audio/mp3">
</audio>
and I have tried
$(document).ready(function() {
$("#audio").get(0).play();
$('#audio').prop("volume", 0.2);
}
then it didn't work.
Is there any other idea to autoplay audio, when the page is loaded?