fix(video-player): fixes looping video Seekbar and timestamp going on indefinitely as video restarts

This commit is contained in:
LucasGGamerM 2023-09-18 10:36:32 -03:00
parent af60c8ba4a
commit 77e2c6c09f
1 changed files with 1 additions and 1 deletions

View File

@ -602,7 +602,7 @@ public class PhotoViewer implements ZoomPanView.Listener{
private void updateVideoPosition(){ private void updateVideoPosition(){
if(videoPositionNeedsUpdating){ if(videoPositionNeedsUpdating){
int currentPosition=videoInitialPosition+(int)(SystemClock.uptimeMillis()-videoInitialPositionTime); int currentPosition=(videoInitialPosition+(int)(SystemClock.uptimeMillis()-videoInitialPositionTime))%videoDuration;
videoSeekBar.setProgress(Math.round((float)currentPosition/videoDuration*10000f)); videoSeekBar.setProgress(Math.round((float)currentPosition/videoDuration*10000f));
updateVideoTimeText(currentPosition); updateVideoTimeText(currentPosition);
windowView.postOnAnimation(videoPositionUpdater); windowView.postOnAnimation(videoPositionUpdater);