Join the conversation

Sign in to join this conversation, and others like it, in the communities you care about.

Frontend Hub

Talk anything related Frontend development, HTML/CSS, client side Javascript, Bootstrap, etc

Frontend Hub / General

Audio auto play not working

Audio auto play not working

Frontend Hub / General · March 17, 2020 at 8:39am

I used below code but it is not playing automatically, I am understand why it is not working. Please help me some.

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


March 20, 2020 at 2:16am

Not all browsers support all those tags. Some browsers do now allow autoplay. You should Google search for some other music playing code.

    like-fill
    1
    • reply
    • like

    March 31, 2020 at 10:19pm

    use modernizr for backwards compatibility and legacy codes. This will help you create a better experience for users in case of exceptions.

      like-fill
      1
      • reply
      • like