Ionic/react HTML audio stops playing after backgrounding the app for some minutes

328 Views Asked by At

We have an app heavily focused on streaming audio files using the HTML audio tag player. In some Android devices the stream will stop after about 3 minutes after the user has minimized/backgrounded the app. Then they will have to foreground the app again and pause-play the track to continue. Sometimes it loses the stream completely when you foreground the app. On other devices it continues playing nornally. I've already tried using the cordova-plugin-background-mode and I enable it on app initialization but seems to be not working. Will I be forced to use native audio player to solve this?

ionic info:
Ionic:

Ionic CLI : 6.17.1 (/home/nikosx/.npm-global/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 5.6.9

Capacitor:

Capacitor CLI : 3.3.3
@capacitor/android : 3.3.3
@capacitor/core : 3.3.3
@capacitor/ios : 3.3.3

Utility:

cordova-res (update available: 0.15.4) : 0.15.3
native-run : 1.5.0

System:

NodeJS : v14.18.1 (/usr/bin/node)
npm : 6.14.15
OS : Linux 5.13
0

There are 0 best solutions below