Music Player App play while not focused

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SF123

I’m working on a music player app for my Android device, but once I go home or turn off the screen of the device the music stops…any way I could change that?

Thanks in advance!

:bust_in_silhouette: Reply From: ReudsFratt92

I have no idea, and I think you can’t, because it’s a game engine. App is designed to act like game, so the solution either doesn’t exist, either it requires you to write custom android plugin which is… tiresome

:bust_in_silhouette: Reply From: sporx13

As Calinou once said:

As far as I know, Godot projects can’t play background audio on iOS/Android because the OS will kill the app anytime it can to save
battery. You have no control over this – the “keep background app
alive” permission is not guaranteed to be 100% reliable.

A game engine isn’t meant to run in the background as it would eat
through the device’s battery very quickly.