Android - <audio> tag: stop streaming after a while

Hey,

I use and audio tag to stream music in a Ionic app, it works, coolio, I hear music, alright.

But on Android after a while, when the app is in the background or when the screen is locked, the music stop playing. I’m guessing it’s due to the Android Doze which put the app to sleep. So anyone knows a tricks to let the audio still stream/play the music?

It should be possible, App like Spotify doesn’t fall a sleep after a while…

Thx in advance for any ideas

My all code is there: https://github.com/peterpeterparker/couleur3-light/tree/dev

P.S.: cordova-media-plugin same problem, howler.js isn’t a solution as it can’t stream a feed using web audio api

1 Like

Did you solve it? I have same situation.

I wonder if using https://github.com/katzer/cordova-plugin-background-mode#store-compliance
would help.

are you asking me? no idea, it was two years ago and I only did that small project as an exercise, didn’t pushed it further. sorry not being able to help