Open Guardiannw opened 1 year ago
There is DataSourceBitmpaLoader
in the main branch that we will release with 1.1.0 I think.
This bitmap loader can handle content://
URIs.
Can you give a bit more detail what use case is not working with content://
URIs?
Because I actually thought that if a URI with content://
scheme is delivered to the System UI as artworkUri
I'd actually expect that System UI would download that bitmap instead of the Media3 library.
Thanks for the response Marc. So, the way that it seems to work right now, if the content URI is provided via artworkUri, it does work in some scenarios, such as in Android Auto, but it does not work with the default notification provided by MediaSession. I think this is just because the SimpleBitmapLoader
doesn't support the content://
URIs by default. In the event a content://
URI is supplied currently, the notification simply has a white background with no image. It seemed like this should be something that is included since it is such a common thing, especially when working with media, however, the DataSourceBitmapLoader
you mentioned might be an appropriate solution. Right now I have gotten around the issue by creating my own BitmapLoader
, but it just seemed like something that should be supported by default.
Ah, yes sorry, my bad. It only works on API 33 without converting the URI to a bitmap, because before API 33 we need to use the largeIcon
of the notification for it and this requires to use a byte array.
We will include the DataSourceBitmapLoader
into 1.1.0 and also change the demo app to use this. I leave this enhancement open until we have done this. Thanks for reporting!
I'm not sure if I'm understanding the issue correctly, but I do use uris and they show notification images both on Api 33 as well as api 28 for instance:
[REQUIRED] Use case description
Currently, the notification displayed from the MediaSession loads URIs from the web via
https://
but it does not loadcontent://
URIs. This is catalogued but never followed up in issue #9 at the final comment.Proposed solution
Adjusted the Bitmap loader to also load content URIs.
Alternatives considered
None