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 returns null values if player is set to Player.REPEAT_MODE_ONE #9458

Closed
marcqtan opened this issue Sep 21, 2021 · 3 comments
Closed
Assignees
Labels

Comments

@marcqtan
Copy link

marcqtan commented Sep 21, 2021

  • ExoPlayer version number: 2.15.0
  • Android version: OS 10
  • Android device: Samsung a35

I am playing a local mp3 and to get its information,I've override onMediaMetadataChanged to get the title information like below:

    override fun onMediaMetadataChanged(mediaMetadata: MediaMetadata) {
        title = mediaMetadata.albumTitle.toString()
    }

At first run, It's successfully showing the title of the currently playing item, but when I set the player.repeatmode to REPEAT_MODE_ONE and right after player goes back to 00:01 position, the onMediaMetadataChanged gets called again but right now all datas are null including the title. See image below:

Screen Shot 2021-09-21 at 4 01 08 PM

It should retain all the datas from before. Any idea why this is happening?

Thanks!

@marcqtan
Copy link
Author

It's working fine in v2.14.2..

@marcqtan

This comment has been minimized.

@ojw28
Copy link
Contributor

ojw28 commented Sep 24, 2021

@Samrobbo - I think the condition here probably needs to be:

if (mediaItemTransitioned
    || !previousPlaybackInfo.staticMetadata.equals(newPlaybackInfo.staticMetadata)) {

else staticMetadata doesn't get correctly merged into newMediaMetadata in the case that newMediaMetadata has been updated by the code block above, but staticMetadata is unchanged. It would be good if we could get a fix in for the next minor release. Thanks!

marcbaechinger pushed a commit that referenced this issue Sep 30, 2021
@ojw28 ojw28 closed this as completed Oct 1, 2021
@google google locked and limited conversation to collaborators Dec 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants