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

[FR] Android Headless Start from Android Auto #2206

Open
lovegaoshi opened this issue Oct 15, 2024 · 1 comment
Open

[FR] Android Headless Start from Android Auto #2206

lovegaoshi opened this issue Oct 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@lovegaoshi
Copy link
Contributor

lovegaoshi commented Oct 15, 2024

Is your feature request related to a problem? Please describe.
headless start from android auto without DRAW_OVER_OTHER_APPS

Describe the solution you'd like
I think i figured this all out now as I did the migration to media3. Not sure if this is applicable to RNTP 4.1.1/exoplayer2.

Effectively I was wrong that the android service started by Auto doesnt start the JS engine. It does. It's just the view renders do not, plus RNTP forbids background player setup by default. So the trick is to move all player setups and relevant listeners out of any hooks, and move them into index.js instead (for example, inside PlaybackService() of TrackPlayer.registerPlaybackService(() => PlaybackService);). the example app should start headlessly now

This may be fairly tedious if many of the listeners are set up as hooks.

The old DRAW_OVER_OTHER_APPS method is still a dumb plug and play way to enable sorta headless playback.

Describe alternatives you've considered
N/A

Additional context
N/A

Please feel free to join our Discord and chat with us in the #dev channel if you'd like to work on this.

@lovegaoshi lovegaoshi added the enhancement New feature or request label Oct 15, 2024
@lovegaoshi
Copy link
Contributor Author

my app using this headless fork just passed the google store review.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant