[Android] Remote access: proper artwork fallback for the playing video

Nicolas Pomepuy git at videolan.org
Thu Sep 26 07:14:42 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Sep 24 15:39:45 2024 +0200| [dad188ff71fc27a6349cd6cd5ddddd72431e805d] | committer: Nicolas Pomepuy

Remote access: proper artwork fallback for the playing video

> https://code.videolan.org/videolan/vlc-android/commit/dad188ff71fc27a6349cd6cd5ddddd72431e805d
---

 .../java/org/videolan/vlc/webserver/RemoteAccessRouting.kt    | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessRouting.kt b/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessRouting.kt
index 71ea35073b..2120f556f8 100644
--- a/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessRouting.kt
+++ b/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessRouting.kt
@@ -1297,6 +1297,17 @@ fun Route.setupRouting(appContext: Context, scope: CoroutineScope) {
                         }
                     }
                 }
+
+                // try video cover
+                RemoteAccessServer.getInstance(appContext).service?.currentMediaWrapper?.let {
+                    ThumbnailsProvider.getVideoThumbnail(it, 512)?.let {
+                        BitmapUtil.encodeImage(it)?.let {
+                            call.respondBytes(ContentType.Image.PNG) { it }
+                            return at get
+                        }
+                    }
+                }
+
                 // nothing found . Falling back on the no media bitmap
                 appContext.getBitmapFromDrawable(R.drawable.ic_no_media, 512, 512)?.let {
 



More information about the Android mailing list