react-native-track-player
react-native-track-player copied to clipboard
[Feature Request] Android Auto
What is the need and use case of this feature? In order to support the proper media architecture and ultimately support Android Auto, the music service would have to implement MusicBrowserServiceCompat.
Describe the ideal solution
The MusicService.kt
extends MusicBrowserServiceCompat
Describe alternatives you've considered Not sure of any alternative.
Additional context
I saw this old issue #598, so I'm aware this is probably a no-go. But I'm really just curious what I would lose in a forked project if I swapped out HeadlessJsTaskService
with a MediaBrowserServiceCompat
.
My ultimate goal here is to be able to use the services in this library and extend them to be able to support Android Auto and Google Assistant commands.
How I can Help What can you do to help get this feature into production? I can be available to test the feature as needed.
Can you assist by working on this feature and creating a Pull Request? The services area is not my area of expertise, unfortunately.
@lostchopstik
I think android auto support would be excellent. With that said I don't think the approach you suggest will work. The HeadlessJSTaskService is necessary perform JS executions while an app is in the background. Removing it would interrupt headless events.
I'm not sure what the correct approach is but if you're willing to do some legwork on it it might be worth getting the insights of @mpivchev and @dcvz
@lostchopstik as @jspizziri mentioned, we need the headless task service for RN functionality to work and we can't implement both.
We haven't given auto support a lot of thought and it's not in our immediate roadmap, but if it's something you're willing to work on we can get @mpivchev to brainstorm with us on ideas for implementation possibilities.
@dcvz I can certainly work on it, and I've got a good amount of bandwidth to do so right now. I would definitely need the brainstorming to figure out what direction to go.
Both Android Auto and Apple Carplay would be awesome. There are some work going on in https://github.com/birkir/react-native-carplay/issues/81 regarding the possibility of supporting both with React Native, but I am not sure if and how this would integrate with RNTP, and I think it does not have a working Playing Now template which would be important for an app using RNTP.
I wonder if there's a way to be able to create a CarPlay app that can trigger play/pause/skip using the SoundPlayerService?
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Moving to the feature backlog
Any progress/alternative solutions regarding this?
There's active development for android auto in #2094
is there any support for Apple CarPlay?
is there any support for Apple CarPlay?
@harrymash2006 For CarPlay there's this package which integrates nicely with RNTP: https://github.com/birkir/react-native-carplay/issues/43
@DanielKuhn yes I am trying to integrate this but do not have any idea how it exactly works due to lack of examples.
@harrymash2006 There's a fully-fledged react native CarPlay example provided by the package: https://github.com/birkir/react-native-carplay/tree/master/apps/example
Integrating the package boils down to
- adding a useEffect somewhere in your app that listens to the
CarPlayConnected
event provided by the package - pushing a base template onto the CarPlay stack
- starting track player playback based on an
itemSelected
event - pushing the NowPlaying template onto the CarPlay stack
let me check, in meantime if any one have example using track player and cardplay please share, thanks and I really appreciate the help @DanielKuhn.
@harrymash2006 Did you manage to run the example app in react-native-carplay ? if so the latest version ? I am getting a bunch of errors