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

161
Vistas
Detect if audio is playing on the website

This is somewhat a duplicate of this question, but I do not understand on how to use the accepted answer. Furthermore the question is quite old and maybe there is a better way available now.

My use case:

I want to test if audio in general is playing with Playwright. The audio source is not a DOM-Element, so checking media elements is not a solution.

This is how the code would get used:

const isAudioPlaying = page.evaluate(() => {
    /* Code goes here */
})

Edit: And this is how the code of the media playback looks like in its most simple form:

function createAudioPlayer() {
    const audio = new Audio()

    return {
      setSource: (src) => audio.src = src,
      play: () => audio.play,
      pause: () => audio.pause,
      resume: () => audio.resume,
    }
}

This factory just uses the default Audio constructor for the playback. It never touches the DOM like that.

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