[android-developers] Re: how to determine length of a video programmatically?

2010-03-26 Thread Abhi
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 simone.russ...@gmail.com wrote:
 Try the MediaPlayer.getDuration() method
 Simone

 On Fri, Mar 26, 2010 at 5:58 PM, Abhi abhishek.r.sha...@gmail.com 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 android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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.


[android-developers] Re: how to determine length of a video programmatically?

2010-03-26 Thread Abhi
Hi,

Could anyone tell me how to use getDuration() method for VideoView? I
tried using getDuration() much after using setVideoPath() but the
result is always the same -1.

Abhi

On Mar 26, 1:19 pm, Abhi abhishek.r.sha...@gmail.com wrote:
 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 simone.russ...@gmail.com wrote:

  Try the MediaPlayer.getDuration() method
  Simone

  On Fri, Mar 26, 2010 at 5:58 PM, Abhi abhishek.r.sha...@gmail.com 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 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
   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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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.


[android-developers] Re: how to determine length of a video programmatically?

2010-03-26 Thread Yahel
Have you checked that your setVideoPath returns a correct video path ?

Can you see the video when calling the start method ?

Yahel

On Mar 26, 6:46 pm, Abhi abhishek.r.sha...@gmail.com wrote:
 Hi,

 Could anyone tell me how to use getDuration() method for VideoView? I
 tried using getDuration() much after using setVideoPath() but the
 result is always the same -1.

 Abhi

 On Mar 26, 1:19 pm, Abhi abhishek.r.sha...@gmail.com wrote:



  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 simone.russ...@gmail.com wrote:

   Try the MediaPlayer.getDuration() method
   Simone

   On Fri, Mar 26, 2010 at 5:58 PM, Abhi abhishek.r.sha...@gmail.com 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs
 cr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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.


[android-developers] Re: how to determine length of a video programmatically?

2010-03-26 Thread Abhi
yes there is nothing wrong with the video path and the video plays
fine.

thanks

On Mar 26, 2:18 pm, Yahel kaye...@gmail.com wrote:
 Have you checked that your setVideoPath returns a correct video path ?

 Can you see the video when calling the start method ?

 Yahel

 On Mar 26, 6:46 pm, Abhi abhishek.r.sha...@gmail.com wrote:

  Hi,

  Could anyone tell me how to use getDuration() method for VideoView? I
  tried using getDuration() much after using setVideoPath() but the
  result is always the same -1.

  Abhi

  On Mar 26, 1:19 pm, Abhi abhishek.r.sha...@gmail.com wrote:

   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 simone.russ...@gmail.com wrote:

Try the MediaPlayer.getDuration() method
Simone

On Fri, Mar 26, 2010 at 5:58 PM, Abhi abhishek.r.sha...@gmail.com 
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 
 android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs
  cr...@googlegroups.com
 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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.