Вопрос

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?

Это было полезно?

Решение

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 .

Другие советы

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);
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top