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

121
Vistas
Check if AudioContext is ready without warning

Using Chrome 103.0.5060.114.

Even if I do the following to prevent the error Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. on two images that play a sound when hovered:

$('#prevImage, #nextImage').hover(_ => {

    // Check modern Chrome autoplay permission on first interaction against getting an error
    if ((new AudioContext()).state == 'running') {
        SoundNames.MAP_HOVER.play()
    }
})

Browser produces the warning The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.

How could I check if the Audio element is ready without a warning? (SoundNames.MAP_HOVER is an Audio object)

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