Skip to content
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

[Feature Request] Android Auto #1533

Closed
lostchopstik opened this issue May 6, 2022 · 17 comments
Closed

[Feature Request] Android Auto #1533

lostchopstik opened this issue May 6, 2022 · 17 comments

Comments

@lostchopstik
Copy link

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.

@jspizziri
Copy link
Collaborator

@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

@dcvz
Copy link
Contributor

dcvz commented May 7, 2022

@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.

@jspizziri jspizziri changed the title [Feature Request] MediaBrowserServiceCompat [Feature Request] Android Auto May 7, 2022
@lostchopstik
Copy link
Author

@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.

@martinmidtsund
Copy link
Contributor

Both Android Auto and Apple Carplay would be awesome. There are some work going on in birkir/react-native-carplay#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.

@davidsalib
Copy link

I wonder if there's a way to be able to create a CarPlay app that can trigger play/pause/skip using the SoundPlayerService?

@github-actions
Copy link
Contributor

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.

@jspizziri
Copy link
Collaborator

jspizziri commented Sep 16, 2022

Moving to the feature backlog

@jspizziri jspizziri moved this from Feature Requests to Backlog in React Native Track Player Sep 20, 2022
@kristjanulst
Copy link

Any progress/alternative solutions regarding this?

@DanielKuhn
Copy link

DanielKuhn commented Aug 23, 2023

There's active development for android auto in #2094

@harrymash2006
Copy link

is there any support for Apple CarPlay?

@DanielKuhn
Copy link

is there any support for Apple CarPlay?

@harrymash2006 For CarPlay there's this package which integrates nicely with RNTP: birkir/react-native-carplay#43

@harrymash2006
Copy link

@DanielKuhn yes I am trying to integrate this but do not have any idea how it exactly works due to lack of examples.

@DanielKuhn
Copy link

@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

@harrymash2006
Copy link

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.

@elieT27
Copy link

elieT27 commented Dec 6, 2023

@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

@syedslegend786
Copy link

syedslegend786 commented May 30, 2024

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.

Hi, i am building a react native+ RNTP app , i want to play my audio podcasts on android-auto, but iam facing alot of errors.
Do you have any working example project , which you can share with me,

@DanielKuhn
Copy link

@syedslegend786 you need to check out #2094

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

10 participants