1.獲取網(wǎng)絡(luò)視頻的第一幀要加 media.setDataSource(ServiceBuilder.IMG_SERVER+url,new HashMap<>());
MediaMetadataRetriever media = new MediaMetadataRetriever();
media.setDataSource(url,new HashMap<>());
//獲取第一幀
Bitmap bitmap = media.getFrameAtTime(1, MediaMetadataRetriever.OPTION_CLOSEST_SYNC );
videoBinding.videoplayer.thumbImageView.setImageBitmap(bitmap);
2.獲取本地視頻 mmr.setDataSource(path);