Hi to all

           I tried to play the video through sdcard image... But i got
a error like
"Cannot play the video".. Can anyone tell me what is the error in my
code...


public class SimpleVideo extends Activity {
        private VideoView myVideo;
        private MediaController mc;
        @Override
        public void onCreate(Bundle icicle) {
                super.onCreate(icicle);
                getWindow().setFormat(PixelFormat.TRANSLUCENT);
                setContentView(R.layout.main);
                Button bPlayVideo=(Button)findViewById(R.id.playvideo);
                bPlayVideo.setOnClickListener(new View.OnClickListener() {
                public void onClick(View view) {
                        mc.show();      }
                                });
                        myVideo=(VideoView)findViewById(R.id.video);
                        myVideo.setVideoPath("/sdcard/test.mp4");
                        mc=new MediaController(this);
                        mc.setMediaPlayer(myVideo);
                        myVideo.setMediaController(mc);
                        myVideo.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