Ignore invalid position updates

Closes #2642
This commit is contained in:
ByteHamster 2018-04-17 14:39:53 +02:00
parent 9b20aeaedd
commit cf2422b1db
1 changed files with 4 additions and 0 deletions

View File

@ -209,6 +209,10 @@ public class ExternalPlayerFragment extends Fragment {
}
private void onPositionObserverUpdate() {
if (controller.getPosition() == PlaybackService.INVALID_TIME
|| controller.getDuration() == PlaybackService.INVALID_TIME) {
return;
}
mProgressBar.setProgress((int)
((double) controller.getPosition() / controller.getDuration() * 100));
}