I am making a media player where I am showing videos from the remote server(e.g. youtube). I have shown a list of videos but I am unable to get the length of videos. (I have searched on this site but I got answers regarding how to get time duration of the video which is locally stored. I am giving the link to one of such question. How to get length in milliseconds of video from URL without video view in Android?)
Asked
Active
Viewed 1,057 times
1 Answers
0
MediaPlayer mp= new MediaPlayer();
mp.setDataSource(context,uri);
int durartion = mp.getDuration();

zys
- 1,306
- 3
- 18
- 37