Skip to content

When playing a MediaItem on Android Auto the queue only contains the currently selected MediaItem #156

Closed
@vanniktech

Description

@vanniktech

Media3 Version

1.0.0-beta02

Devices that reproduce the issue

Android Auto with Pixel 6 Pro

Devices that do not reproduce the issue

Reproducible in the demo app?

Not tested

Reproduction steps

In my onGetLibraryRoot, I have the following code:

internal val rootMediaItem: MediaItem by lazy {
  MediaItem.Builder()
    .setMediaId(PARENT_ID)
    .setMediaMetadata(
      MediaMetadata.Builder()
        .setFolderType(MediaMetadata.FOLDER_TYPE_MIXED)
        .setIsPlayable(false)
        .build()
    )
    .build()
}
  
  
override fun onGetLibraryRoot(
  session: MediaLibrarySession,
  browser: MediaSession.ControllerInfo,
  params: LibraryParams?,
): ListenableFuture<LibraryResult<MediaItem>> {
  val rootExtras = Bundle().apply {
    putBoolean(
      MediaConstants.BROWSER_SERVICE_EXTRAS_KEY_SEARCH_SUPPORTED,
      true,
    )
    putBoolean("android.media.browse.CONTENT_STYLE_SUPPORTED", true)
    putInt(
      MediaConstants.DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE,
      MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM,
    )
    putInt(
      MediaConstants.DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE,
      MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM,
    )
  }
  val libraryParams = LibraryParams.Builder().setExtras(rootExtras).build()
  return Futures.immediateFuture(LibraryResult.ofItem(rootMediaItem, libraryParams))
}

in onGetChildren, I load all of my items and they are being displayed just fine:

Screen Shot 2022-08-17 at 23 27 20

Expected result

When selecting one, I'd expect to use the List of MediaItem so that I can automatically skip ahead

Actual result

My queue contains only the selected item:

Screen Shot 2022-08-17 at 23 28 20

Media

Bug Report

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions