Playing Audio in the Background using Flutter

9,618

Solution 1

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:

Solution 2

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

Solution 3

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.

Share:
9,618
Greg
Author by

Greg

Updated on December 20, 2022

Comments

  • Greg
    Greg over 1 year

    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, soon as you move to another app or lock your phone the music stops.

    Does anyone have any tips?

    • Bilaal Abdel Hassan
      Bilaal Abdel Hassan almost 4 years
      It works well on android?
    • Greg
      Greg almost 4 years
      Yes seems to work fine on android
    • Bilaal Abdel Hassan
      Bilaal Abdel Hassan almost 4 years