3

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.

Sumesh P
  • 385
  • 2
  • 10
  • 3
    that would be a hell in the subway... – Kaiido May 30 '16 at 05:45
  • 3
    I hope the answer is no. Honestly, why would you play background music on a website? That must be one of the most annoying things, makes most of your visitors leave immediately. – Karsten Koop May 30 '16 at 07:04

0 Answers0