android / uamp

A sample audio app for Android
Apache License 2.0
13.09k stars 3.76k forks source link

Use URIs for artwork #235

Open nic0lette opened 6 years ago

nic0lette commented 6 years ago

Currently UAMP stuffs Bitmaps into the MediaMetadataCompat objects, but this makes the object use a lot more memory, and forces the use of low resolution images (which are then poorly rendered on large surfaces, such as the background of the lock screen).

The app should use local URIs that point to a ContentProvider and use METADATA_KEY_ALBUM_ART_URI and METADATA_KEY_ART_URI to provide that for use by other components.

technicalflaw commented 5 years ago

+1 for this. I can literally find no examples of artwork supplied via a content provider, and using a bitmap destroys performance on android auto for sizes greater than 320x320.

trustedtomato commented 5 years ago

I've looked into this, and the main problem is that if a bitmap is not set, there is no artwork displayed on the lock screen (https://developer.android.com/guide/topics/media-apps/working-with-a-media-session#album_artwork). So the bitmap should be made on the fly when it's needed (& destroyed when it isn't), but I couldn't figure out how to do that.

kennysaelen commented 3 years ago

@nic0lette Awesome! Tested this yesterday and the art renders nicely. Can't wait to run it on the car when I pick it up on monday ;-)