title: Playing subsection of video in android
body: <p>In android I have a 3 min length video. I have three buttons.
  On first button click i want the 1st min video play only.
  On second button click from 1st min to 2nd min video play only
  and on third button click the rest of video.</p>
  
  <p>The order of click can be changed. Is it possible to do it?</p>
  
  <p>I used the below code </p>
  
  <pre><code>videoPlayer = (VideoView) findViewById(R.id.videoPlayer);   
      videoPlayer.setOnPreparedListener(this);
      videoPlayer.setOnCompletionListener(this);
      videoPlayer.setKeepScreenOn(true);    
    //  videoPlayer.setVideoPath(root + "/" + pathToFile);
     // ResourceUtil.setVideo(videoPlayer,"cbse_g08_s01_l01_t01_sc11");
      videoPlayer.setVideoPath(ResourceUtil.getResourceFilePath("cbse_g08_s02_l16_t01_03a",
              MSConstants.RESOURCE_TYPE_VIDEO));
  
  
      leftButton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
               Log.i("arv", "click"+"left"+videoPlayer.getDuration());
              //if(videoPlayer.canSeekBackward()())
                  videoPlayer.seekTo(videoPlayer.getDuration());
              videoPlayer.start();
          }
      });
  
      midButton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
               Log.i("arv", "click"+"mid"+videoPlayer.getCurrentPosition());
               //if(videoPlayer.canSeekForward())
                   videoPlayer.seekTo(videoPlayer.getDuration()/5);
                  videoPlayer.start();
          }
      });
  
      rightButton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
               Log.i("arv", "click"+"right");
              //if(videoPlayer.canSeekForward()) 
                  videoPlayer.seekTo(videoPlayer.getDuration()/10);
              videoPlayer.start();
          }
      });
  </code></pre>
  
  <p>But it played the video from the given time to end.
  Is there any other way to do it. </p>