saa
saa

Reputation: 1568

MediaStore.Video.Thumbnails.getThumbnail

I have been trying to load video thumbnails to my gridView. It is loading thumb nails very slowly if i use ThumbnailUtils.createVideoThumbnail. So i decided to use MediaStore.Video.Thumbnails.getThumbnail. But What is origld. and how can i pass this element to this method? I have refer MediaStore.Video.Thumbnails.getThumbnail() returns null link also. But it is not helpful for me

Upvotes: 0

Views: 2063

Answers (1)

GrIsHu
GrIsHu

Reputation: 23638

 public static Bitmap getThumbnail (ContentResolver cr, long origId, long groupId, int kind, BitmapFactory.Options options)

This method checks if the thumbnails of the specified image (origId) has been created. It will be blocked until the thumbnails are generated.

Parameters

  • cr- ContentResolver used to dispatch queries to MediaProvider.
  • origId - Original image id associated with thumbnail of interest.
  • groupId - the id of group to which this request belongs
  • kind- The type of thumbnail to fetch. Should be either MINI_KIND or MICRO_KIND
  • options- this is only used for MINI_KIND when decoding the Bitmap

As it defines the original image id of the video thumbnail you need to pass the image id of your video thumbnail in this parameter.

For more details Check out HERE

public static Bitmap getThumbnail (ContentResolver cr, long origId, long groupId, int kind, BitmapFactory.Options options)
// origid  is the Images.ImageColumns._ID
//groupid is the Images.ImageColumns.BUCKET_ID 

Upvotes: 2

Related Questions