Skip to content

[FR] Android Headless Start from Android Auto #2206

Open
@lovegaoshi

Description

@lovegaoshi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions