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

195
Vistas
Using AudioContext stops the audio from playing in the background

I've been playing around with the Web Audio API and ran into a weird problem.

At the moment, if you open a web page on your phone and click the play button on an HTML5 audio element, the audio will keep playing in the background even after switching apps.

However, when you attach the element to an AudioContext, the audio will stop playing in the background after switching apps.

To attach the element, I'm using the following:

const context = new AudioContext()
const source = context.createMediaElementSource(document.querySelector("audio"))

source.connect(context.destination)

So even though I'm simply connecting the HTML5 audio element to the context's destination WITHOUT controlling it, the audio stops playing as soon as I switch apps.

Does anyone know why this is happening and how I can get the audio to keep playing in the background even after switching apps? It's odd that we can use the Web Audio API to control audio on the web, but we have to keep our browsers open and our phones unlocked to listen to that audio.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The intended behavior is for audio to stop on browser exit on phones, because it saves on background processing and from a user standpoint, I think the expected behavior would be that audio stops when you close out.

I think you just have audio working incorrectly on the specific device.

over 4 years ago · Santiago Trujillo 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