The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

+1 vote

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!

Godot version v3.4.2.stable.official [45eaa2daf]
in Engine by (236 points)

2 Answers

+1 vote
Best answer

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.

by (77 points)
selected by
+1 vote

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

by (68 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.