-
Notifications
You must be signed in to change notification settings - Fork 299
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
Unify cover art sources in a configurable manner #1380
Comments
Hi @OxygenCobalt, Thanks for diving deep around the
Our current strategy is always prioritizing to use And if you have both
The And I also saw that you've mentioned that from Android 11 onwards, the media notification picks the random covers. Could you please elaborate this issue a bit? |
Since Android 11, media notifications draw from either the notification data (content title, content text, bitmap) or the MediaSession's current MediaMetadata. The issue is that the data picked depends on several factors, such as the OEM build, internal race conditions, or notification rate limiting. I discovered this on my own before I was using Media3, where if I did not synchronize metadata updates to be in the order of MediaSession and THEN the medianNotification, the metadata would not properly update. My final system was something like:
As far as I am aware, Media3 still launches two cover loads from I have a hunch that this issue is at least related to new ones I've discovered when moving to Media3:
I'm not fully confident about the root cause, but both of these seem to me that there is no way to guarantee cover consistency here without causing confusing behavior. I've just been forced to fall back to whatever ExoPlayer does instead rather than using my own internal loader until I can effectively rebuild the entire MediaStore image system and just pass URIs everywhere. |
[REQUIRED] Use case description
My app has two sources of cover art. It has a Coil setup with a bunch of extensions/settings options that would ideally be provided by
BitmapLoader
, and just plainMediaStore
URIs stored inMediaItem
s. However, It seems as if ExoPlayer seemingly erratically uses three different cover art sources depending on what's being applied.MediaSessionCompat
cover metadata is directly read from theMediaMetadata.artworkUri
orMediaMetadata.artworkData
of aMediaItem
, judging by this code. This is not configurable.BitmapLoader
, which can be configurable.This leads to several issues.
BitmapLoader
will only apply to the notification, not theMediaSessionCompat
.BitmapLoader
in it's current form, since you have no idea if it's going to randomly pick some other cover source.Please correct me if I don't fully understand the behavior or reasoning here.
Proposed solution
Make updates to the covers in media notification,
MediaSessionCompat
, and other places rely on a synchronized call toBitmapLoader
that allows full configuration on what cover data should be used. The only place this can be excluded is anything related to theMediaBrowser
, since I know that's a little infeasible.Alternatives considered
I can somewhat alleviate this on my end by unifying my cover sources with my own internal URI-based system, but this is extremely complicated and I can't do this right now. It also doesn't rule out the case of ExoPlayer auto-parsing it's own metadata and overriding mine, since I don't know what conditions trigger that.
The text was updated successfully, but these errors were encountered: