Skip to content
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

MediaMetadata extras do not get populated when only setExtras used in Builder #1176

Open
1 task
akshdeep-singh opened this issue Mar 11, 2024 · 1 comment
Open
1 task
Assignees
Labels

Comments

@akshdeep-singh
Copy link

Version

Media3 1.3.0

More version details

No response

Devices that reproduce the issue

Pixel 5 API 34 Emulator

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

This works:

val extras = Bundle().apply { putString("uri", uri) }
val mediaMetadata = MediaMetadata.Builder()
    .setDisplayTitle(title)
    .setExtras(extras)
    .build()
val mediaItem = MediaItem.Builder()
    .setUri(uri)
    .setMediaMetadata(mediaMetadata)
    .build()
override fun onMediaItemTransition(mediaItem: MediaItem?, reason: Int) {
   println(mediaItem?.mediaMetadata?.extras?.getString("uri"))
   // NOT null
}

This doesn't work (when only setExtras are used):

val extras = Bundle().apply { putString("uri", uri) }
val mediaMetadata = MediaMetadata.Builder()
    .setExtras(extras)
    .build()
val mediaItem = MediaItem.Builder()
    .setUri(uri)
    .setMediaMetadata(mediaMetadata)
    .build()
override fun onMediaItemTransition(mediaItem: MediaItem?, reason: Int) {
   println(mediaItem?.mediaMetadata?.extras?.getString("uri"))
   // null
}

Same issue with playlistMetadata.

Expected result

MediaMetadata extras should not be null.

Actual result

MediaMetadata extras are null.

Media

I am observing this issue for all mp3 files (not tested for other types).

Bug Report

@tonihei
Copy link
Collaborator

tonihei commented Mar 14, 2024

Thanks for reporting! We'll provide a fix for this in the next bugfix release (1.3.1).

@tonihei tonihei self-assigned this Mar 14, 2024
copybara-service bot pushed a commit that referenced this issue Mar 25, 2024
This ensures MediaMetadata with just non-null extras is not
considered equal to MediaMetadata.EMPTY. This makes sure the
contents are bundled when a controller sets the extras in a
new MediaItem

Issue: #1176

#minor-release

PiperOrigin-RevId: 618876642
copybara-service bot pushed a commit to google/ExoPlayer that referenced this issue Mar 25, 2024
This ensures MediaMetadata with just non-null extras is not
considered equal to MediaMetadata.EMPTY. This makes sure the
contents are bundled when a controller sets the extras in a
new MediaItem

Issue: androidx/media#1176

#minor-release

PiperOrigin-RevId: 618876642
SheenaChhabra pushed a commit that referenced this issue Apr 8, 2024
This ensures MediaMetadata with just non-null extras is not
considered equal to MediaMetadata.EMPTY. This makes sure the
contents are bundled when a controller sets the extras in a
new MediaItem

Issue: #1176

PiperOrigin-RevId: 618876642
(cherry picked from commit ab03911)
l1068 pushed a commit to l1068org/media that referenced this issue Apr 15, 2024
This ensures MediaMetadata with just non-null extras is not
considered equal to MediaMetadata.EMPTY. This makes sure the
contents are bundled when a controller sets the extras in a
new MediaItem

Issue: androidx#1176

PiperOrigin-RevId: 618876642
(cherry picked from commit ab03911)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants