// 获取视频缩略图
public Bitmap getVideoThumbnail(String filePath) {
Bitmap b=null;
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
retriever.setDataSource(filePath);
b=retriever.getFrameAtTime();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (RuntimeException e) {
e.printStackTrace();
} finally {
try {
retriever.release();
} catch (RuntimeException e) {
e.printStackTrace();
}
}
return b;
}
android 根据视频路径获取视频缩略图
最新推荐文章于 2024-07-08 02:29:27 发布