facebook / facebook/fresco

SimpleDraweeView not showing video thumbnails

Open
#2,206 6 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Kotlin
Stars
17.2k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

Hi all,

I'm developing a gallery app for Android devices. I create a private encrypted field for users to hide their media. I use SimpleDraweeView in the whole project to display the images on the screen. I do not do anything extra to view the hidden media. In this case, the thumbnails of the videos are not displayed when the images are displayed. Although both types are the same as the extension, ImageRequestBuilder can not show video thumbnails. My code;

@JvmStatic
@BindingAdapter("app:newImagePath", "spanCount")
fun newImagePath(imageView: SimpleDraweeView, newImagePath: String, spanCount: Int) {
if (newImagePath.isNotEmpty()) {
val screenWidthSize = imageView.context.windowManager.defaultDisplay.width
val spanPixel = screenWidthSize / spanCount
val uri = Uri.fromFile(File(newImagePath))
val request = ImageRequestBuilder.newBuilderWithSource(uri)
.setResizeOptions(ResizeOptions(spanPixel, spanPixel))
.build()
imageView.setImageRequest(request)
} else
imageView.setImageBitmap(null)
}

![whatsapp image 2018-09-12 at 15 25 40](https://user-images.githubusercontent.com/22412494/45424804-439a2c00-b6a0-11e8-908c-5c2a2b56db31.jpeg)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.