title: how to get total length of video in video view in android
body: <p>I have a problem that I want to get total length of video which is running in Video View for this I am using getDuration Method of video view but it always returns -1 when I am comparing it with currentPosition. Actually I want that if video's currentposition is equals to the total length of the video then it should start from the 0th position means starting. Mean I want to say that I want to compare Video current position with the total length of the video, how can I do that?</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>videoPosition=VideoPositionFinding(IDValue,video.getDuration());
      video.seekTo(videoPosition);
      if(video.getCurrentPosition()==video.getDuration()){
          videoPosition=0;
      }
       locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
       System.out.println("The Video Duration: "+video.getCurrentPosition());
  
       video.start();
  </code></pre>