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

IcyInfo should be used in MediaMetadata #153

Closed
y20k opened this issue Aug 16, 2022 · 7 comments
Closed

IcyInfo should be used in MediaMetadata #153

y20k opened this issue Aug 16, 2022 · 7 comments
Assignees
Labels

Comments

@y20k
Copy link

y20k commented Aug 16, 2022

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.

@icbaker
Copy link
Collaborator

icbaker commented Oct 6, 2022

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?

@google-oss-bot
Copy link
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!

@y20k
Copy link
Author

y20k commented Oct 28, 2022

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!

@icbaker
Copy link
Collaborator

icbaker commented Oct 28, 2022

Glad it's working!

@y20k
Copy link
Author

y20k commented Jan 21, 2023

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?

@icbaker
Copy link
Collaborator

icbaker commented Jan 23, 2023

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.

@y20k
Copy link
Author

y20k commented Jan 23, 2023

Okay. I created a new issue.

@androidx androidx locked and limited conversation to collaborators Mar 3, 2023
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