Skip to content

IcyInfo should be used in MediaMetadata #153

Closed

Description

@y20k

Some radio streams publish Icecast metadata. ExoPlayer extracts Icecast metadata in the form of

  • IcyHeaders and
  • IcyInfo.

IcyHeaders are used to populate the station and genre fields in MediaMetadata. You can check that for example in onMediaMetadataChanged(Player.Listener): station and genre are being updated.

IcyInfo usually contains information like the currently playing song. It is being extracted properly. You can check that for example in onMetadata(Player.Listener). There is also a function that can populate MediaMetadata. I would correctly update the title field. Problem: It seems like this function is never used, because the title field is not updated in onMediaMetadataChanged(Player.Listener).

I tested this behavior in the Media Session Demo app. If you want to reproduce the behavior you would need run the forked app and start the radio station that I added to catalog.json and filter LogCat for "ICY issue" (1) (2) (3).

I think IcyInfo should be used in MediaMetadata because it contains really interesting information about the currently playing media.

Activity

  1. self-assigned this
    on Aug 16, 2022
  2. icbaker commented on Oct 6, 2022

    @icbaker
    Collaborator

    I think the IcyInfo title is already incorporated into MediaMetadata. In order to see this in the main (not session) demo app I needed to first comment out the setMediaMetadata call here, because ExoPlayer assumes that developer-provided metadata should override stream-provided metadata (so the title from the IcyInfo is never set into MediaMetadata, and so it never changes and the callback is never called):

    .setMediaMetadata(new MediaMetadata.Builder().setTitle(title).build())

    I think the same issue (developer-provided metadata overriding media-provided) probably affects your session demo example too.

    Can you take a look and see if you can also get this working in the main demo app as I've described?

  3. google-oss-bot commented on Oct 26, 2022

    @google-oss-bot
    Collaborator

    Hey @y20k. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

    If you have more information that will help us get to the bottom of this, just add a comment!

  4. y20k commented on Oct 28, 2022

    @y20k
    Author

    Hi @icbaker

    When I use MediaItems that do not have a title set in their metadata, the player uses stream-provided metadata. It works flawless in my own app. The notification automatically displays IcyInfo from the stream.

    Thank you for the clarification and for helping me out!

  5. icbaker commented on Oct 28, 2022

    @icbaker
    Collaborator

    Glad it's working!

  6. y20k commented on Jan 21, 2023

    @y20k
    Author

    Hi @icbaker

    as I wrote in October my app's notification displays IcyInfo metadata, once I do not set the title. ❤️

    There is an unintended consequence of not setting the title though:

    The Always-On Display now reads: No Title

    The photos above are from a fork of the demo-session app (see y20k@2e722ac).

    I now wonder ...
    ... is this something that I can fix?
    ... is this something that you (media3) can fix?
    ... or is this something that needs to be handled differently by the Android platform?

  7. icbaker commented on Jan 23, 2023

    @icbaker
    Collaborator

    Thanks for the update - please can you file a new issue? You can link back to this issue for context, but it's helpful to keep the discussions separate.

  8. y20k commented on Jan 23, 2023

    @y20k
    Author

    Okay. I created a new issue.

  9. locked and limited conversation to collaborators on Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions