How can I get the video file size while recording a video in Android using a MediaRecorder
?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
String recVideoPath = Environment.getExternalStorageDirectory() + videoRecordedFileName;
File file = new File(recVideoPath);
long fileVideo = file.length();
More or less something like the one above.
回答2:
Put this in a thread, or where ever you are updating the UI
currentPosition = (int) mediaPlayer.getCurrentPosition();
yourProgressBar.setProgress(currentPosition);
I hope this helps :)