0

hi i m trying to play a video on video view.

btnPlay.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            if(videoView.isPlaying()) {
                videoView.stopPlayback();
                                }
            else {
                videoView.setVisibility(View.VISIBLE);
                videoView.setVideoPath(path);   
                videoView.setZOrderOnTop(true);                         videoView.start();
                videoView.requestFocus();
            }
        }
    });

    btnClose.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            videoView.stopPlayback();
        }
    });

This is the methodology i followed. But the video is not to be seen Kidnly help me out. I am passing a .mp4 file as path.. Is it a problem with the path

user562237
  • 775
  • 5
  • 15
  • 24

1 Answers1

0

see my answere here for playing a video from a local file (raw) or from a link.

example, load a video from the raw folder:

//path from Raw folder
    String path = "android.resource://" + getPackageName() + "/"+ R.raw.bootanimation_nexus;


... then            
videoView.setVideoURI(Uri.parse(path));
Community
  • 1
  • 1
TouchBoarder
  • 6,422
  • 2
  • 52
  • 60