[android-developers] Re: VideoView path problem

2010-05-04 Thread Abhi
Aman,

Do this to let user pick a video

Intent i = new Intent(Intent.ACTION_PICK);
i.setType(video/*);
startActivityForResult(i, PICK_VIDEO);

and in onActivityResult look for the request code 'PICK_VIDEO' and
pass along the URI of the selected video to another activity this way:

Uri data = intent.getData();

if (data != null) {

Intent i = new Intent(this, YourVideoPlayer.class);
i.setData(data);
startActivity(i);

}

Hope that helps

Abhi



On May 4, 8:27 am, SheikhAman shekh.a...@gmail.com wrote:
 I am using a VideoView to play videos.
 it works smoothly.

 with only one problem. i am able to provide path of video with this
 way-

 Uri uri = Uri.parse(android.resource://com.abc.def/+ R.raw.vid);
 video.setVideoURI(uri);
 video.start();

 but this is not what i want.
 i want it to take the path dynamically, so that i can tell it the path
 according to the user selection.

 any suggestions??

 --
 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 
 athttp://groups.google.com/group/android-developers?hl=en

-- 
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


[android-developers] Re: VideoView path problem

2010-05-04 Thread SheikhAman
I didnt get you completely.

I have this activity called VideoPlayer.java, which receives the video
name from the user through a listview selection.
and this activity has some other controls as well like buttons and
more.

Inside this activity, i have setup a video view  which plays the
videos, and have made it to react to button events too.
this video view gets the video source as the path as shown above.
however i can't always provide path like that, since there are 300
videos to choose from.

what i wanted to know is, is there some way by which i can provide it
with a name of the video selected.
I know the video path in my project, its inside res/raw/video.mp4
so if there's anyway i can provide path like that, it would be
extremely helpful

if you could suggest me, how to refer to resources which i have
bundled with my app in res/ forlder, that would also help.

Thanks

On May 4, 10:44 pm, Abhi abhishek.r.sha...@gmail.com wrote:
 Aman,

 Do this to let user pick a video

 Intent i = new Intent(Intent.ACTION_PICK);
 i.setType(video/*);
 startActivityForResult(i, PICK_VIDEO);

 and in onActivityResult look for the request code 'PICK_VIDEO' and
 pass along the URI of the selected video to another activity this way:

 Uri data = intent.getData();

 if (data != null) {

 Intent i = new Intent(this, YourVideoPlayer.class);
 i.setData(data);
 startActivity(i);

 }

 Hope that helps

 Abhi

 On May 4, 8:27 am, SheikhAman shekh.a...@gmail.com wrote:



  I am using aVideoViewto play videos.
  it works smoothly.

  with only one problem. i am able to provide path of video with this
  way-

  Uri uri = Uri.parse(android.resource://com.abc.def/+ R.raw.vid);
  video.setVideoURI(uri);
  video.start();

  but this is not what i want.
  i want it to take the path dynamically, so that i can tell it the path
  according to the user selection.

  any suggestions??

  --
  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 
  athttp://groups.google.com/group/android-developers?hl=en

 --
 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 
 athttp://groups.google.com/group/android-developers?hl=en

-- 
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