Reference:
https://stackoverflow.com/questions/33770188/how-can-i-get-the-duration-resolution-of-a-video-file-programmatically-in-andro/33770238
Code snippet:
MediaPlayer mp = MediaPlayer.create(this, Uri.parse(uriOfFile));if(mp == null){
Log.e(TAG, "The record file is invalid");
return;
}
int duration = mp.getDuration();
沒有留言:
張貼留言