Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

122
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda