How to get real-time video file size in Android?

How to get video file size when recording video on Android using MediaRecorder ?

+6
source share
2 answers
 String recVideoPath = Environment.getExternalStorageDirectory() + videoRecordedFileName; File file = new File(recVideoPath); long fileVideo = file.length(); 

More or less something similar to the above.

+1
source

Put this on a stream or when you update the user interface

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

Hope this helps :)

-1
source

Source: https://habr.com/ru/post/914696/


All Articles