-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Change metadata for a MediaItem during playback #9978
Comments
I believe If that doesn't work, please provide a minimal reproducible example that demonstrates the problem in a way that we can build locally. This could be an Android Studio project on GitHub, or zipped up and sent to [email protected] using a subject in the format "Issue #1234", where "#1234" should be replaced with your issue number. Please also update this issue to indicate you’ve done this. |
yep, I've already tried you can find a reproducible example here: https://github.com/NikSatyr/media2-radio. please see PS: Make sure you follow the instructions from the README to setup the ExoPlayer locally (I understand that ExoPlayer devs perfectly know how to do this, but still don't forget to do so :)) |
I'd also like to point out that we need this metadata not only for the notification (so some tweaks to MediaDescriptionAdapter would not be enough), but for |
@icbaker sorry to bother you, but this blocks our development process. did you have a chance to take a look? |
any updates here? |
Sorry for the delay looking into this. Thanks for the repro project, it was really helpful and nice and simple. This is a limitation of ExoPlayer: It's not currently possible to change the item metadata of a currently-playing I'm going to mark this as an enhancement. |
This changes all MediaSources in our library to allow updates to their MediaItems (if supported). Issue: google/ExoPlayer#9978 Issue: #33 PiperOrigin-RevId: 546808812
This changes all MediaSources in our library to allow updates to their MediaItems (if supported). Issue: #9978 Issue: androidx/media#33 PiperOrigin-RevId: 546808812
Hi, when is an update planned with these changes? |
This is now possible using |
I'm having a hard time figuring out how to supply custom metadata for the ExoPlayer (or maybe it's better to say side-load). We support some sort of radio functionality, which is delivered via
ProgressiveMediaSource
. The problem is that the radio stream may contain malformed metadata due to the human factor (e.g. incorrect title, missing artwork). However, we have a dedicated "now playing" endpoint on our server that returns 100% accurate metadata (don't ask me why :)).What I need to achieve is to periodically update the metadata (by calling the above mentioned endpoint) (for instance to update the track info in the notification) without re-setting the media item with the radio url. This is because the radio stream url is always the same and we set it only once, while songs on the radio are obviously being changed, and we'd like to reflect the song changes (title, artist, artwork etc) in the notification.
Previously we've been using
mediaSession.setMetadata()
for this purpose, but as we migrated to media2 this method is marked as library restricted, so I don't think it's a good option.Could you please advise the solution?
The text was updated successfully, but these errors were encountered: