user1257441
user1257441

Reputation: 81

How to get file size of live video recording in android?

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

Upvotes: 7

Views: 1539

Answers (2)

Salmaan
Salmaan

Reputation: 3624

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

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

I hope this helps :)

Upvotes: -1

Lawrence Gimenez
Lawrence Gimenez

Reputation: 3255

String recVideoPath = Environment.getExternalStorageDirectory() + videoRecordedFileName;

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

More or less something like the one above.

Upvotes: 1

Related Questions