I have a problem with the fact that I want to get the total length of a video that works in Video View for this. I use the getDuration view method to view the video, but it always returns -1 when I compare it to currentPosition. In fact, I want that if the current video image is equal to the total length of the video, it should start from 0 position means start. I want to say that I want to compare the current position of the video with the total length of the video, how can I do this?
Thanks in advance.
The 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();
source share