Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

116
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda