-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(guides): add an Expo guide #2296
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dctalbot , thanks for taking the time to write this up. I think this could be a great addition! Left some feedback for you.
Hey, just chiming in here because we have been using this library in our Expo based app for a while. We needed to figure some things out ourselves so I definitely think adding documentation will be very helpful to others! I have some comments and suggestions:
import { PlaybackService } from './src/services/PlaybackService'
// ...
registerRootComponent(App)
// We need to register a playback service right after registering the main component of the app
TrackPlayer.registerPlaybackService(() => PlaybackService)
|
Points 1 and 3 are good 👍🏻 @isilher On point 2, I'm not sure I'm seeing the full picture in that example. The default entry point already calls Regardless, you're probably right. It probably is not strictly necessary to call I will follow-up with another commit soon. BTW, I have an example open source project here - https://github.com/dctalbot/spinitron-mobile-app |
@dctalbot you are correct! I was checking our git history for including this library and assumed the pre-existing |
Another note: on iOS, you'll need to update {
ios: {
infoPlist: {
UIBackgroundModes: ["audio"],
},
},
} |
I had an issue on Expo web because shaka-player is a dynamic import. Might be worth mentioning in this guide. My current workaround is to create two files in a shaka-player folder in my project, index.ts (empty file), index.web.ts (has an import of shaka-player with this line "import 'shaka-player/dist/shaka-player.ui';"). This works as it forces the shaka-player import on web, but would be nice to see first party Expo web support. |
@andordavoti , definitely would love for Expo web to work. I'm curious if this PR addresses your issue. Would you be able to take it for a spin and let me know? Apart from that, I'd be happy to work with you separately on Expo web support. But it's definitely something I'll need assistance on due to my ignorance surrounding Expo. Why don't we move the conversation to the linked PR for now. |
@dctalbot sorry, I have it set to auto-merge, but it looks like the docs build is failing to an invalid link. Would you be able to sort that out? |
@jspizziri I just moved away from Solito / NextJS to Expo router for my app today. I had gotten RNTP working perfect in Next but instantly hit the issue @andordavoti was having when I moved to Expo web. Just checked this PR and saw you talking about expo web support today. Couldn't be better timing haha, thanks @andordavoti for sharing and @jspizziri for keeping this project going! |
@isilher thanks for sharing your example project–that was really helpful 🙏 |
No description provided.