I am trying to add a background music for my website. By using audio tag, i can accomplish this in desktop browsers. But is not working in mobile browsers. In my search i get to know that auto play is disabled in mobile browsers. It would be grateful if anybody can help me on this issue. The code i am trying is
<audio id="audio_id" autoplay="autoplay" loop="true" controls="false" hidden="true">
<source src="assets/audio/music.mp3" />
</audio>
I also tried
$(document).ready(function() {
var audio = document.getElementById('audio_id');
audio.play();
});
Thanks in advance.