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



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:

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