How to get file size of live video recording in an

2019-04-26 16:27发布

How can I get the video file size while recording a video in Android using a MediaRecorder?

2条回答
走好不送
2楼-- · 2019-04-26 16:56

Put this in a thread, or where ever you are updating the UI

currentPosition = (int) mediaPlayer.getCurrentPosition();
yourProgressBar.setProgress(currentPosition);

I hope this helps :)

查看更多
太酷不给撩
3楼-- · 2019-04-26 17:09
String recVideoPath = Environment.getExternalStorageDirectory() + videoRecordedFileName;

File file = new File(recVideoPath);
long fileVideo = file.length();

More or less something like the one above.

查看更多
登录 后发表回答