Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ThumbnailUtils.createVideoThumbnail is not work in samsung tablet 10.1

I try to create a thumbnail of android SD card video. This are the function i use to create video thumbnail

Bitmap thumb = ThumbnailUtils.createVideoThumbnail("sdCard_Video_Path",MediaStore.Video.Thumbnails.MINI_KIND);

But I get video thumbnail in all phone without samsung tablet 10.1. In samsung tablet 10.1 it show black thumbnail.

Why this function is not work in samsung tablet 10.1

I am also check that the bitmap is null or not

if (thumb != null) {
imageView.setImageBitmap(thumb);

But the samsung tablet 10.1 do not give any null bitmap but it show black in thumbnail

help via comment or link.
like image 231
Md Abdul Gafur Avatar asked Dec 06 '25 10:12

Md Abdul Gafur


1 Answers

You should copy Android source code (ThumbnailUtils.java) to your code and replace createVideoThumbnail function, change setDataSource(link) to setDataSource(link, new HashMap());

Reference: https://code.google.com/p/android/issues/detail?id=35794

like image 180
user3391900 Avatar answered Dec 08 '25 00:12

user3391900



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!