Replies: 3 comments 2 replies
-
|
The Audio Player plugin should already support background music. Can you share more information? What is the exact issue? Which Android versions are affected? |
Beta Was this translation helpful? Give feedback.
-
|
I think the problem comes from old device then, cause i got skipped frame, rate alert, and sometimes the music is cutted, or just don't launch when it goes to next track (on android) |
Beta Was this translation helpful? Give feedback.
-
|
Hi Robin, thanks for the reply. The issue appears specifically on older Android devices (e.g., Android 8.1 / API 27) and ROMs with aggressive battery management (like Xiaomi MIUI). The exact scenario: The app plays a track using AudioPlayer. A Foreground Service is running to keep the app alive. When the track finishes (screen locked), the native player stops and releases the audio wakelock. The Gap: At this precise momentβbefore the JS stop event listener can trigger and call play() for the next trackβthe OS suspends the WebView/JS thread because it detects silence + locked screen. As a result, the next track never starts (or starts only when I wake up the screen). Even with a Foreground Service, the round-trip to the JS thread (Native Stop -> JS Event -> JS Logic -> Native Play) is too slow or blocked by the OS on these devices. I believe the only robust solution for these devices would be a way to handle the queue natively, to avoid depending on the JS thread for the transition. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Do audio plugin support background task ? I mean when the Android is lock, it seems sometimes the music with the media session is cut.
Do i have to use background plugin with it to enable support on old android locked ?
Beta Was this translation helpful? Give feedback.
All reactions