Audio playback: background and player controls


#1

I’m making a audio player app and would like two things
1) ability to play audio in background.
This seems to be planned here.
https://expo.canny.io/feature-requests/p/audio-playback-in-background
Is there any kind of timeline on this feature? Just an unofficial guesstimate from expo team if possible would be appreciated here.

Is there a recommended 3rd party component to achieve this in the meantime that works well with expo?

2) have a player control overlay that is either persistent in notification bar or is available on select screens
What is the best/recommended approach here?
Have a fixed footer on all target screens that selectively shows itself if the player is playing?


#2

hey, not on the team but I know they update the status of features to ‘in progress’ when its in active development, so don’t know if they can provide an estimate right now.

for a few examples of audio players, there’s two examples you can try out and check the source for on the expo audio page. could be useful template for a dedicated screen for your player


#3

thanks @samee. I looked at those examples but they don’t show how to have the player persist while navigating amongst screens


#4

hi-

expo doesn’t have a way to do background audio, or background things in general, yet unfortunately.

you’ll likely need to do your own native programming to make this work unfortuantely.

Detaching may be useful for that.
https://docs.expo.io/versions/latest/guides/detach.html#content

There are some feature requests around background tasks here (they are currently at the top of our priority list) and you can vote on or comment on them: https://expo.canny.io/feature-requests

good luck!


#5

Yeah I figured i would have to go that route.

I realize this is out of the scope of Expo, but was wondering if anyone reading this specifically had recommendations on a react-native player component that was good for this.


#6

I have detached my app, and added the plist configuration for playing background audio. I’ve also seen that the Expo audio player uses AVAudioSessionCategoryPlayback which should continue playing in the background, but I cant get it to work. Any ideas here?


#7

I am personally using https://github.com/zmxv/react-native-sound for a meditation app. But I really like expo’s Audio API. One other candidate is react-native-video.


#8

@rickiesmooth I also wonder, did you manage to make background audio possible with the expo player, by detaching? would really appreciate any help! thank you


#9

I’ve tried react-native-sound but I didnt really like that library, although it did play audio in the background. Also tried to fiddle around with the native expo code but I couldn’t get background sound to work.


#10

Any news on when this will be available in Expo? I know that it’s one of the planned features, but would love to get an estimate on when it will be worked on if there’s intel out there! About to choose Expo for a project, but it all depends on this feature…