skip to Main Content

How to autoplay an audio in Chrome browser?
I found some similar question in here, but when i try the solution they gave, it didn’t work for me.
Any new solution for this problem?

3

Answers


  1. You can use this code

    Your browser does not support the audio element.

    Login or Signup to reply.
  2. To autoplay an audio file in the Chrome browser you can just add autoplay in the audio tag

    Example:

    <audio id="audio_id" autoplay>
      <source src="path/to/audiofile.mp3" type="audio/mpeg">
    </audio>
    
    Login or Signup to reply.
  3. You can try this. This code is from w3schools.com for more info you can visit there official site.

    <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>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search