Media.getDuration() for Video always returns 0

Viewed 15

I am looking for the duration of a Video just recorded.

Code:

String file = Capture.captureVideo();
Media m = MediaManager.createMedia(file, true);
m.getDuration();

returns 0 on (PC, IOS, Android)

Thoughts?

1 Answers

Duration isn't available for most cases until after media playback was started since the media might be streamed this can take time but normally just playing the media will make duration return a valid value.

Related