Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

112
Views
Autoplay audio not working on any browser

I am designing an HTML page and added an audio in the header there using the below code:

<audio id="audio_play">
    <source src="voice/Story 2_A.m4a" type="audio/ogg" />
</audio>
<img class="head-icon" src="img/audio.png" onClick="document.getElementById('audio_play').play(); return false;" />
<img class="head-icon2" src="img/audio2.png" onClick="document.getElementById('audio_play').pause(); return false;" />

But now I want to autoplay the audio on page load. I am using autoplay both on the audio tag and the source tag. But can't help. Even removed the last 2 lines of the code following this, but that too won't help.

You can check the page directly from here.

As per the code added, it is playing the audio upon clicking on the icon now. I am not sure what I am missing to make it autoplay on page load.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Audio/Video has been restricted from autoplaying. They can play only with user interaction. Also please keep the format of the audio file as ogg instead of m4a as you have specified the type as audio/ogg. Change from voice/Story 2_A.m4a to voice/something.ogg

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!