Last active
August 29, 2015 14:18
-
-
Save JonghyuKim/d6c6bd7b0a25340b3fc6 to your computer and use it in GitHub Desktop.
[Android]Video Thumbnail get bitmap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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