How to get duration of a video file?

后端 未结 7 411
暖寄归人
暖寄归人 2020-12-07 20:07

I\'m a beginner in Android programming.

I\'m writing an application to list all video file in a folder and display information of all videos in the folder. But when

7条回答
  •  -上瘾入骨i
    2020-12-07 20:28

    MediaPlayer mpl = MediaPlayer.create(this,R.raw.videoFile);   
    int si = mpl.getDuration();
    

    This will give the duration of the video file

提交回复
热议问题