Question

I have a video file in my sdcard. I would like to show a preview of this video in my ImageView . I know that there is a API:

ThumbnailUtils.createVideoThumbnail(videoFile,
        MediaStore.Images.Thumbnails.MINI_KIND)

but it always returns null, is there any alternative?

Was it helpful?

Solution

Its working for me

 Bitmap thumb = ThumbnailUtils.createVideoThumbnail(filePath, MediaStore.Images.Thumbnails.MINI_KIND);

please check once, if you are passing path of video file .

OTHER TIPS

MediaStore.Images.Thumbnails.MINI_KIND and MediaStore.Video.Thumbnails.MINI_KIND are both integers with value 1

So try this first

Bitmap bmp = ThumbnailUtils.createVideoThumbnail(videoPath,1);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top