开发者

display video thumbnails from sdcard in android [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How to get thumbnail for video in my /sdcard/Android/data/mypackage/files folder ?

Hello All

开发者_运维知识库

In my android application i am recording a video and saving this in sdcard. Now what i require is display this video as thumbnails in my application.

I tried all solutions from Android: Is it possible to display video thumbnails? The issue is i need the video from sdcard path and am not understanding as how to get it.

I tried below code

int id = **"The Video's ID"** 
ImageView iv = (ImageView ) convertView.findViewById(R.id.imagePreview); 
ContentResolver crThumb = getContentResolver(); 
BitmapFactory.Options options=new BitmapFactory.Options(); 
options.inSampleSize = 1; 
Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb, id,MediaStore.Video.Thumbnails.MICRO_KIND, options); 
iv.setImageBitmap(curThumb);

But could not understand as how to get the video from sdcard path.

Please share your valuable suggestions

Thanks in advance :)


You can check out ThumbnailUtils as per this answer, provided you are on Android 8 (Froyo) or later.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜