From 115404edd82ea145f8b1ccae04d9d75cef0c305d Mon Sep 17 00:00:00 2001 From: Tom Van Laerhoven Date: Mon, 12 Aug 2024 10:02:47 +0200 Subject: [PATCH] Add missing artUri property --- .../connector/mediasession/MediaMetadataProvider.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/connectors/mediasession/src/main/java/com/theoplayer/android/connector/mediasession/MediaMetadataProvider.kt b/connectors/mediasession/src/main/java/com/theoplayer/android/connector/mediasession/MediaMetadataProvider.kt index c4ea9c5e..15bd022d 100644 --- a/connectors/mediasession/src/main/java/com/theoplayer/android/connector/mediasession/MediaMetadataProvider.kt +++ b/connectors/mediasession/src/main/java/com/theoplayer/android/connector/mediasession/MediaMetadataProvider.kt @@ -10,6 +10,7 @@ private const val PROP_ALBUM_ART = "albumArt" private const val PROP_ALBUM_ARTIST = "albumArtist" private const val PROP_ALBUM_ART_URI = "albumArtUri" private const val PROP_ART = "art" +private const val PROP_ART_URI = "artUri" private const val PROP_ARTIST = "artist" private const val PROP_AUTHOR = "author" private const val PROP_COMPILATION = "compilation" @@ -125,6 +126,13 @@ class MediaMetadataProvider(private val connector: MediaSessionConnector) { builder.putBitmap(MediaMetadataCompat.METADATA_KEY_ART, value) } + /** + * See [MediaMetadataCompat.METADATA_KEY_ART_URI]. + */ + fun setArtUri(value: String?) { + builder.putString(MediaMetadataCompat.METADATA_KEY_ART_URI, value) + } + /** * See [MediaMetadataCompat.METADATA_KEY_ARTIST]. */ @@ -315,6 +323,9 @@ class MediaMetadataProvider(private val connector: MediaSessionConnector) { if (metadata.containsKey(PROP_ART)) { setArt(metadata.get(PROP_ART) as? Bitmap) } + if (metadata.containsKey(PROP_ART_URI)) { + setArtUri(metadata.get(PROP_ART_URI) as? String) + } if (metadata.containsKey(PROP_ARTIST)) { setArtist(metadata.get(PROP_ARTIST) as? String) }