Greg
Greg

Reputation: 71

Playing Audio in the Background using Flutter

We have created an app using the flutter platform.

Music plays fine, but we are struggling to get the app to play audio in the background on iOS devices. As soon as the user moves to another app or locks their phone, the music stops.

Does anyone have any tips on how to keep apps alive, running in the background, and playing audio even while the app does not have user focus?

Upvotes: 5

Views: 20166

Answers (3)

loyal
loyal

Reputation: 257

There are some flutter packages that play audio in the background and they are controlled on the lock screen.

Upvotes: 5

Terrence Skill
Terrence Skill

Reputation: 129

Just activate in : Signing&Capabilities /-----> +Capabilities -------> BackgroundModes : Audio, AirPlay,Picture in Picture

if your player streams music from a server also enable background fetch

Image of Capabilities in XCode

look at the picture above:

Upvotes: 4

Ajay Vaidhyanathan
Ajay Vaidhyanathan

Reputation: 43

You can use flutter package to implement background audio play as well as lock controls. https://pub.dev/packages/flutter_playout

Check this. Hope it helps.

Upvotes: 2

Related Questions