[Android] Avoid asking Android for video thumbnails for distant medias

Nicolas Pomepuy git at videolan.org
Thu Jun 10 09:40:57 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue May 25 13:10:59 2021 +0200| [81ea8379c43e7cbfcd7e5030ee4c183b06ef2ae8] | committer: Nicolas Pomepuy

Avoid asking Android for video thumbnails for distant medias

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

 application/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt b/application/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt
index f2dc29116..578f19752 100644
--- a/application/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt
+++ b/application/vlc-android/src/org/videolan/vlc/util/ThumbnailsProvider.kt
@@ -87,7 +87,7 @@ object ThumbnailsProvider {
         if (hasCache && File(thumbPath).exists()) return readCoverBitmap(thumbPath, width)
         if (media.isThumbnailGenerated) return null
         var bitmap = synchronized(lock) {
-            ThumbnailUtils.createVideoThumbnail(filePath, MediaStore.Video.Thumbnails.MINI_KIND)
+            if (media.uri.scheme.isSchemeFile()) ThumbnailUtils.createVideoThumbnail(filePath, MediaStore.Video.Thumbnails.MINI_KIND) else null
         }
         if (bitmap != null) {
             val emptyBitmap = Bitmap.createBitmap(bitmap.width, bitmap.height, bitmap.config)



More information about the Android mailing list