美文网首页
获取视频第一帧

获取视频第一帧

作者: 阳光下的美好_6e13 | 来源:发表于2019-05-27 10:03 被阅读0次

1.获取网络视频的第一帧要加 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);

相关文章

网友评论

      本文标题:获取视频第一帧

      本文链接:https://www.haomeiwen.com/subject/gwdctctx.html