Se detiene el audio al apagar la pantalla del teléfono

Hola a todos,
Cada vez que apago la pantalla del móvil en unos 4 minutos el audio se detiene. Quisiera que me ayuden a encontrar la solución.

Tengo ese mismo problema, y al parecer no lo corrigen. Stream de audio de detiene sin importar la forma que lo use (por bloques, por html, o por js) pasa lo mismo

I'm pretty sure it's because the application stops running; since there's no way to keep it running in the background, while it's locked. You could try setting a wake lock or modifying your settings.

I already did the test, leaving the screen on with the app in the foreground. likewise, the app stops the audio in a short period of time, forcing you to click play again. I thought it was mobile internet problems but it still fails to connect to wifi

1 Like

This should work (if the app is in the foreground, the screen is visible). I've tested this over and over again on dozens of devices and all versions of Android for years. But if the app is in the background or in idle (sleep) mode, a Foreground service is always required so that it works on all devices (i.e. the device does not fall into Doze mode).

The problems with streaming / radio apps have been discussed intensively and extensively in all forums (AI2, Kodular, …) for years (also with the MIT and Kodular staff). Search the appropriate forums. I made a final statement on this and presented the solution, after testing this on dozens of devices and all Android versions from KitKat onwards.

So search the forum (and the corresponding other forums) and you will find what you are looking for.

Last here:

https://community.appinventor.mit.edu/t/streaming-radio-drop-out-technical-advice/1213/30?u=anke

1 Like