androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
Apache License 2.0
1.34k stars 315 forks source link

Getting the current queue of MediaItems via a MediaBrowser #1465

Closed FilipKastrupGP closed 2 weeks ago

FilipKastrupGP commented 2 weeks ago

Hi,

I'm working on implementing a playing queue in Media3. On the service side, I'm using MediaLibraryService which contains an ExoPlayer. I add media items via MediaBrowser.addMediaItem(...).

The Problem: After adding a MediaItem, the ExoPlayer's Timeline.windowCount increases by 1, but the MediaBrowser's Timeline.windowCount does not reflect this change.

This discrepancy is noticeable when comparing the Timeline.windowCount in MediaBrowser and ExoPlayer.

Question: What could I be missing? Is there a better way to retrieve the items in the current queue?

FilipKastrupGP commented 2 weeks ago

I will close this issue. We disabled the queue from being shown in android auto, but forgot to enable it else where... To be clear we this is the cause:

MediaSession.ConnectionResult.DEFAULT_PLAYER_COMMANDS.buildUpon()
                .remove(Player.COMMAND_GET_TIMELINE) // Queue button in Android Auto
                .build()