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

664
Vistas
Error Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first, how can i solve this?

I'm making a game for a school project and want to add music to the login screen. When my page loads, I get the error Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.

This is my function to play the audio

function speelmuziek() {
 var audio = new Audio('sounds/waitsound.mp3');
 audio.play()
}

And I use this in the body of my page to load the function.

<body onload="speelmuziek()">

How can I solve this?

about 4 years ago · Juan Pablo Isaza
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