2020/08/07
The issue: mobile browsers tend to stop playback in the following cases:
- When the screen is off and the song is ended (Android / iOS)
- Seems to be working fine in Chromium-based browsers (first successful test 2023/04/30).
- When the browser is pushed out of memory by bringing other resource-heavy apps to the foreground (Android / iOS??)
The problem is that JavaScript execution is prevented under those conditions under the guise of saving battery life.
Firefox for Android seems to be less likely to stop playback (I can play music for hours on my S5 with LineageOS, while trying this on Bromite will stop playback after a single song).
There seem to be some hacks available, such as constantly playing a (fake-ish) video in the background, but they're messy. If there's a proper solution, I'd love to be pointed towards it.
@sbncbot @OoLunar @Invictaz @xRadio-us
I found that for some people on mobile devices playback tends to stop a while after the screen is turned off. I'm not sure whether the cause is due to resource management of the device itself, or a crappy network connection (or whether these are two separate issues). The playback tends to stop in between songs, so it could be caused by JavaScript not being run when the screen is off.
So, playback of the next song stops when:
- Screen is off, or perhaps even when the browser (or just the music player's tab) is put to the background
- Tends to immediately start playback again when I press the pause button :/
My questions to you:
- Have you have experienced a similar issue and what were the exact conditions?
- Can you easily reproduce it? If you can, does enabling crossfade improve the situation?
- Do you know of possible causes and/or solutions?
Some links to information on a possibly related issue:
https://stackoverflow.com/questions/22061280/javascript-halts-in-inactive-android-chrome-tab
https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
https://stackoverflow.com/questions/15959244/is-it-possible-in-javascript-to-detect-when-the-screen-is-turned-off-in-the-an
2020/08/07
The issue: mobile browsers tend to stop playback in the following cases:
The problem is that JavaScript execution is prevented under those conditions under the guise of saving battery life.
Firefox for Android seems to be less likely to stop playback (I can play music for hours on my S5 with LineageOS,
while trying this on Bromite will stop playback after a single song).There seem to be some hacks available, such as constantly playing a (fake-ish) video in the background, but they're messy. If there's a proper solution, I'd love to be pointed towards it.
@sbncbot @OoLunar @Invictaz @xRadio-us
I found that for some people on mobile devices playback tends to stop a while after the screen is turned off. I'm not sure whether the cause is due to resource management of the device itself, or a crappy network connection (or whether these are two separate issues). The playback tends to stop in between songs, so it could be caused by JavaScript not being run when the screen is off.
So, playback of the next song stops when:
My questions to you:
Some links to information on a possibly related issue:
https://stackoverflow.com/questions/22061280/javascript-halts-in-inactive-android-chrome-tab
https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
https://stackoverflow.com/questions/15959244/is-it-possible-in-javascript-to-detect-when-the-screen-is-turned-off-in-the-an