I want to select a video from my Gallery. It\'s working fine. But now I want to display a Bitmap, as a thumbnail.I tired this code it\'s not working, it always says: NullPoi
For API 27, for document URI (1000 is microseconds)
MediaMetadataRetriever mmr = new MediaMetadataRetriever(); mmr.setDataSource( context, doc_uri ); Bitmap bm = mmr.getScaledFrameAtTime( 1000, MediaMetadataRetriever.OPTION_NEXT_SYNC, 128, 128 );