1)获取本地视频的时长:
private int getVideoDuration(String path) { MediametadataRetriever media = new MediametadataRetriever(); media.setDataSource(path); String duration = media.extractmetadata(MediametadataRetriever.metaDATA_KEY_DURATION); return Integer.parseInt(duration); }
2)打开本地视频列表:
Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI); intent.setType("video/*"); startActivityForResult(intent, RECORD_SYSTEM_ALBUM);
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)