[Android] Avoid asking Android for video thumbnails for distant medias
Nicolas Pomepuy
git at videolan.org
Thu Jun 10 09:42:20 UTC 2021
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue May 25 13:10:59 2021 +0200| [c7dd19662e142fe22e4f03aefe4248307b8d807c] | committer: Nicolas Pomepuy
Avoid asking Android for video thumbnails for distant medias
> https://code.videolan.org/videolan/vlc-android/commit/c7dd19662e142fe22e4f03aefe4248307b8d807c
---
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