1.1k
Audio playback in background
in progress
Brent Vatne
this is now partially supported, but you cannot control the audio playback with operating system controls yet
Axel Delafosse
Hi everyone!
You can now use React Native Track Player with Expo.
Start by creating a custom development client for your Expo app and then install React Native Track Player.
Here is the configuration required for audio playback in background:
- iOS: Enable audio playback in background via your app.jsonhttps://docs.expo.dev/versions/latest/sdk/audio/#playing-or-recording-audio-in-background-ios
- Android: Stop playback when the app is closed https://react-native-track-player.js.org/background/#android
And don't forget to register a playback service.
Enjoy :)
Activity
Newest
Oldest
Zander Bournand
Even after installing track player with "expo install react-native-track-player" I keep getting the following error:
"Native module cannot be null".
I am not sure how to tackle this issue as I cannot open the project in xcode to follow step 2 that can be found under the installation instructions https://react-native-track-player.js.org/install/
Please Help :)
Surya
Zander Bournand: same problem have u got solution?
Michael Wood
Surya: You need to build with EAS Build and you cannot use Expo Go. If you want something like Expo Go you will need to build a custom development client as mentioned by Axel and then use that instead of Expo Go.
Surya
Michael Wood: While building eas for ios its getting error You have no team associated with your apple account cannot proceed and in brackets Do u have a paid apple dev account?
Is it compulsory to have apple paid developer account for testing purpose only ?
Michael Wood
Surya: I'm afraid I am not entirely sure of Apple's requirements. See if this documentation helps:
Michael Wood
Surya: Otherwise, I'm pretty sure you should be able to use the Simulator without paying for a developer account.
By the way, I am not a member of the Expo team. I am just another Expo user.
Kevin Crabbe
I can't seem to be able to transition from one audio file to the next in the background. The transition is fine when the app is open but when I close the app, the current file keeps playing until it finishes but the transition to the next file never happens. Is there another way around this?
B
Berk Coker
Audio recording on Android is not supported as well. Need a foreground service to keep recording for anything longer than 15 seconds in the background
Axel Delafosse
in progress
Zach Reed
Yeah, can we not mark this
COMPLETE
just yet, since it isn't full support.David Talbot
Probably shouldn't be marked as complete until https://github.com/expo/expo/issues/4850 is closed
Axel Delafosse
David Talbot: I wasn't aware of this issue with
expo-av
. I'll take a look. Thanks David!By the way, you shouldn't experience this issue when using
react-native-track-player
so the pinned comment solution is still valid.David Talbot
Axel Delafosse: Awesome, thanks so much!
Tomasz Sapeta
complete
Axel Delafosse
Hi everyone!
You can now use React Native Track Player with Expo.
Start by creating a custom development client for your Expo app and then install React Native Track Player.
Here is the configuration required for audio playback in background:
- iOS: Enable audio playback in background via your app.jsonhttps://docs.expo.dev/versions/latest/sdk/audio/#playing-or-recording-audio-in-background-ios
- Android: Stop playback when the app is closed https://react-native-track-player.js.org/background/#android
And don't forget to register a playback service.
Enjoy :)
Axel Delafosse
I can also share an example if needed.
L
Lishar
Axel Delafosse: Having hard time installing react-native-track-player with expo sdk 42. All kinds of dependencies issues. Can you please share an example?
Michael Wood
Lishar: Probably best to ask about this on https://forums.expo.dev under the Third Party Software section. When you do, post more details/error messages about your dependency issues.
L
Lishar
Michael Wood: https://github.com/expo/expo/issues/14642
Sajid Islam
Axel Delafosse: please do.
Xavier Duchesne
Axel Delafosse: How do I register the playback service? I don<t have an index file in my project (and it works). Do I have to go into the expo module? I put this in AppEntry in the "expo" package :
import registerRootComponent from 'expo/build/launch/registerRootComponent';
import TrackPlayer from 'react-native-track-player';
import App from '../../App';
registerRootComponent(App);
TrackPlayer.registerPlaybackService(()=>require('../../service'))
It doesn't work though... Please help !
T
Titor
Xavier Duchesne: Doesn't work for me either. Any example?
Xavier Duchesne
Titor: I'm so sorry, I don't remember! It did play in the background in the end though, so it's possible. I don't think I had changed anything. Maybe just restart your node?
C
Colin D
Where is the documentation for the partial support? Noting on the expo-av page that I can see.
_chidiebere
This feature is only what is missing to make the expo-av or video perfect!. Please release it as soon as you can :)
Load More
→