Skip to content

Instantly share code, notes, and snippets.

@JonghyuKim
Last active August 29, 2015 14:18
Show Gist options
  • Save JonghyuKim/d6c6bd7b0a25340b3fc6 to your computer and use it in GitHub Desktop.
Save JonghyuKim/d6c6bd7b0a25340b3fc6 to your computer and use it in GitHub Desktop.
[Android]Video Thumbnail get bitmap
public class HThumbnailUtil {
public Bitmap getThumbnail(String filePath){
Bitmap bit = ThumbnailUtils.createVideoThumbnail(filePath, android.provider.MediaStore.Video.Thumbnails.FULL_SCREEN_KIND);
if(bit == null){
MediaMetadataRetriever m = new MediaMetadataRetriever();
m.setDataSource(filePath);
bit = m.getFrameAtTime();
}
return bit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment