androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.58k stars 375 forks source link

Set fallback cover to MediaItem (and use by Notification) #1221

Open lynkas opened 6 months ago

lynkas commented 6 months ago

[REQUIRED] Use case description

I'm developing a music app, and I want to set the cover arts to the notification in this way:

Sometime the track has a cover (in audio file), sometime it doesn't. So: if the track has a cover, then make use of it; if the track has no cover, I can provide a Uri (like album cover) as a fallback.

Before 1.3.0 the notification did work in above way if I only set an artworkUri, but now got fixed. (I guess in #964)

Proposed solution

Allow an order for multiple artwork source?

Thanks!

icbaker commented 6 months ago

This is part of a larger change we've been considering to give app developers more control over how MediaItem.mediaMetadata and in-stream metadata are merged (currently MediaItem.mediaMetadata is always used in preference to in-stream metadata). It's not trivial to design how this more flexible merging should be exposed, and I'm afraid we don't have any concrete plans to work on this at the moment, but I will keep this issue open to track it.