ali zolfaghari
- Forum posts: 15
Feb 20, 2015, 9:48:54 AM via Website
Feb 20, 2015 9:48:54 AM via Website
hi
i want to know about duration of a video clip on a website without downloading the clip
is this code do the correct :
v = (VideoView) findViewById(R.id.videoView1);
v.setVideoPath("clip url");
v.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
long duration = v.getDuration();
Toast.makeText(getApplicationContext(), duration + "", 500).show();
}
});
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.