I am using VideoView and I tried using getDuration() this way

* defined VideoView mVideoView earlier in the code..

mVideoView.setVideoPath(getDataSource(path));
long duration = mVideoView.getDuration();
mVideoView.start();

This returns a -1 when I try reading 'duration'

Abi

On Mar 26, 1:12 pm, Simone Russo <[email protected]> wrote:
> Try the MediaPlayer.getDuration() method
> Simone
>
> On Fri, Mar 26, 2010 at 5:58 PM, Abhi <[email protected]> wrote:
> > Is there a way to determine the length of a video before playing it?
>
> > Thanks,
>
> > Abi
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> > To unsubscribe from this group, send email to android-developers+
> > unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> > ME" as the subject.
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to