Android Auto: Click on a Playlist item doesn't change the current playing media
Documented behaviour
Android Auto playlist issue
Actual behaviour
instead of playing the clicked media file, nothing happens, the player still playing the same media file
Minimal reproduction project
Official example: example_playlist.dart
Reproduction steps
1- before running the app please follow this document to Add support for Android Auto to your media app by modifying the AndroidManifest.xml file https://developer.android.com/training/cars/media/auto
2- Open the example app 3- Click the back arrow on Android Desktop Head Unit 4- Click on any item in Albums
we expected to switch to a new media file but Nothing happened,
Output of flutter doctor
[√] Flutter (Channel stable, 3.0.2, on Microsoft Windows [Version 10.0.19043.1766], locale en-US)
Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.67.2)
[√] Connected device (1 available)
[√] HTTP Host Availability
• No issues found!```
### Devices exhibiting the bug
Android Desktop Head Unit
did you manage to look at this issue? thanks
Android Auto support is largely contributed by people who use that feature. If you are interested in contributing yourself, that's great, although if you would like someone else to work on this, you should probably update your bug report with a proper minimal reproduction project to help them.
In the bug submission instructions, you incorrectly answered YES to this question:
The bug is reproducible on the official example (without any code modifications)
And then in the next section, you gave instructions on how to manually modify the code. So your YES answer was not correct, you should instead supply a link to a reproduction project where you yourself have applied the modifications.
FYI, the latest release 0.18.7 contains some contributed updates to the Android Auto code. This may or may not affect your issue, so you may like to test your issue again on this version.
Overriding
Future<void> playFromMediaId(String mediaId,
[Map<String, dynamic>? extras])
from BaseAudioHandler in my AudioPlayerHandler helped a bit in my application (audio starts playing but android auto interface stuck itself at "getting your selection" screen). I potentially try to solve this issue using example app soon, probably I'm still missing something relatively easy from native docs, meanwhile I'm just sharing some progress for anyone finding it as a problem.
@Mordtimer hey, did you manage to fix this? my auto interface is also getting stuck at **getting your selection **
Yes, I fixed this in my app. But I will need some time to create elegant minimal sample for android auto app and submit this as a PR with some documentation for AA to audio_service repo.
Meanwhile just try to insert media item (that id you have from playMediaFromId) to the handler queue and play smith like this:
await handler.addQueueItems(mediaItem)
await startPlaying();