android-smart-image-view icon indicating copy to clipboard operation
android-smart-image-view copied to clipboard

VideoThumbnailImage

Open commonsguy opened this issue 12 years ago • 0 comments

I just posted a sample project that uses SmartImageView to display video thumbnails obtained from MediaStore. The SmartImage implementation is fairly straightforward:

  private static class VideoThumbnailImage implements SmartImage {
    private int videoId;
    private int thumbnailKind;

    VideoThumbnailImage(int videoId, int thumbnailKind) {
      this.videoId=videoId;
      this.thumbnailKind=thumbnailKind;
    }

    @Override
    public Bitmap getBitmap(Context ctxt) {
      return(MediaStore.Video.Thumbnails.getThumbnail(ctxt.getContentResolver(),
                                                      videoId,
                                                      thumbnailKind,
                                                      null));
    }
  }

My code is licensed Apache License 2.0, and I have no qualms if you want to add this code to your project.

commonsguy avatar Jul 31 '13 11:07 commonsguy