-
Notifications
You must be signed in to change notification settings - Fork 460
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
How to disable media Queue button in Android Auto when playing live stream. #339
Comments
This comment was marked as spam.
This comment was marked as spam.
Thanks @marcbaechinger for responding. I have just tried your suggestions, but unfortunately, the queue button is still there. I have also tried removing these commands in the |
Ok, thanks! Will investigate. |
The criteria is whether the queue is empty or not. With Media3, the queue of the legacy session is a function of the media items added to the player. So if there is a media item playing, then the queue is never empty. This is a regression compared to what apps can do with the legacy I changed this issue to a bug and will update this issue when we have news. |
Thanks so much for looking into this! |
@marcbaechinger do we have some option to override |
In fact, when using the support library, this behavior is also observed. I managed to get the playlist off by overriding |
Android Auto shows a queue button when the queue is not empty. Apps were able to remove this queue button with the legacy API by not setting the queue of the session. After this change, removing `COMMAND_GET_TIMELINE` from the commands of the media notification controller or the session player sets the queue in the platform session to null. #minor-release Issue: #339 PiperOrigin-RevId: 573813558
With the commit above that landed in the main branch and will be released with 1.2.0, an app can now remove the queue button in Android Auto/Automotive OS by removing override fun onConnect(
session: MediaSession,
controller: MediaSession.ControllerInfo
): MediaSession.ConnectionResult {
if (session.isMediaNotificationController(controller)) {
val playerCommands =
Player.Commands.Builder().addAllCommands().remove(COMMAND_GET_TIMELINE).build()
return MediaSession.ConnectionResult.AcceptedResultBuilder(session)
.setAvailablePlayerCommands(playerCommands)
.build()
}
} With this the queue is not set on the framework session and the button is not displayed y Auto. An app can change this setting during runtime like for instance when the user adds a playlist instead a radio stream and an app want to alternate between the two behaviors: session.mediaNotificationControllerInfo?.let {
val playerCommands = Player.Commands.Builder().addAllCommands()
val sessionCommands = getSessionCommandsIncludingCustomCommands() // provided by app
session.setAvailableCommands(it, sessionCommands, playerCommands)
} An app can do this even when the app wants to support the System UI notification in parallel. |
@Guardiannw Sorry for the wait and thanks for your report!
You can remove
Na, there is no such method. I think with the option added now, you can now do what you want by API. I'm closing as the question is answered and we now have an API for this. Please open a new issue in case you find issues with the provided solution. |
Android Auto shows a queue button when the queue is not empty. Apps were able to remove this queue button with the legacy API by not setting the queue of the session. After this change, removing `COMMAND_GET_TIMELINE` from the commands of the media notification controller or the session player sets the queue in the platform session to null. #minor-release Issue: #339 PiperOrigin-RevId: 573813558 (cherry picked from commit f53e1bc)
Question:
Under the previous version of the media library, when playing a live stream (HLS) for a radio station, the Queue button did not appear in Android Auto when playing a media item. However, after migrating to the new Media3 library, the Queue seems to be there by default. I have tried to look through the documentation, but cannot find a way to easily disable the Queue button on Android Auto. I assume it has something to do with the new implementation because it was not there for us on the old implementation. Is there any way that I can easily disable the viewing of the queue in Android Auto via the library.
The text was updated successfully, but these errors were encountered: