I'm trying to play a video in a VideoView and I'm failing miserably.
I'm working in an Eclipse emulator and am half expecting it not to
work there, but when I install my app on my Android phone (version
2.2.1) it also fails.  The error message I get is "Cannot play video.
Sorry, this video cannot be played." The video is in the Raw folder.
Below is my code.  parsedData[3].toString() is the name of the video
(without the 3gp extension) which is being extracted from a database
call.  What am I doing wrong?

    VideoView videoview = (VideoView) findViewById(R.id.videoView);
    videoview.setMediaController(new MediaController(this));
    String path = "android.resource://" + getPackageName() + "/R.raw/"
+ parsedData[3].toString();
    videoview.setVideoURI(Uri.parse(path));
    videoview.requestFocus();

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

Reply via email to