Code example for VideoView

Methods: canSeekForwardgetDurationisPlayingseekTostart

0
              
       // Don't start until ready to play.  The arg of seekTo(arg) is the start point in 
       // milliseconds from the beginning. In this example we start playing 1/5 of 
       // the way through the video if the player can do forward seeks on the video. 
        
       if(videoPlayer.canSeekForward()) videoPlayer.seekTo(videoPlayer.getDuration()/5);
       videoPlayer.start();
       Log.i("IS PLAYING", Boolean.toString(videoPlayer.isPlaying()));
    } 
     
    /** This callback will be invoked when the file is finished playing */ 
    @Override 
    public void onCompletion(MediaPlayer  mp) {
       // Statements to be executed when the video finishes. 
       this.finish();	
    } 
     
    /**  Use screen touches to toggle the video between playing and paused. */ 
    @Override 
    public boolean onTouchEvent (MotionEvent ev){
    	Log.i("InSIDE ","TOUCH");