Help Playing Video

All your problems with Audio, Video and Images.

Help Playing Video

Postby plokoon » Wed May 04, 2011 1:27 pm

Hello, I am fairly new to Android and need some help with loading a video into a view.

I've looked online everywhere and I can't seem to get my code to work. Here it is..

ll is a listview that I have declared in onCreate() and inside there I call a method called displayVideo()..

Code: Select all
private DisplayVideo(){

String viewSource ="/sdcard/package/test.mp4";
                getWindow().setFormat(PixelFormat.TRANSLUCENT);
                VideoView vv = new VideoView(this);
                vv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
             //vv.setVideoURI(Uri.parse(viewSource));
                   vv.setVideoPath(viewSource);   
                   vv.setMediaController(new MediaController(this));
                vv.requestFocus();
                   vv.start();
                ll.addView(vv);


}
plokoon
Freshman
Freshman
 
Posts: 3
Joined: Fri Mar 25, 2011 10:50 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 8 guests