Merge pull request #7176 from litetex/fix-progress-bar-end-not-synced
Fixed seekbar not completed after video end
This commit is contained in:
commit
4fc9f2e5fd
|
@ -1597,10 +1597,7 @@ public final class Player implements
|
||||||
setVideoDurationToControls(duration);
|
setVideoDurationToControls(duration);
|
||||||
}
|
}
|
||||||
if (currentState != STATE_PAUSED) {
|
if (currentState != STATE_PAUSED) {
|
||||||
if (currentState != STATE_PAUSED_SEEK) {
|
updatePlayBackElementsCurrentDuration(currentProgress);
|
||||||
binding.playbackSeekBar.setProgress(currentProgress);
|
|
||||||
}
|
|
||||||
binding.playbackCurrentTime.setText(getTimeString(currentProgress));
|
|
||||||
}
|
}
|
||||||
if (simpleExoPlayer.isLoading() || bufferPercent > 90) {
|
if (simpleExoPlayer.isLoading() || bufferPercent > 90) {
|
||||||
binding.playbackSeekBar.setSecondaryProgress(
|
binding.playbackSeekBar.setSecondaryProgress(
|
||||||
|
@ -2248,6 +2245,9 @@ public final class Player implements
|
||||||
stopProgressLoop();
|
stopProgressLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When a (short) video ends the elements have to display the correct values - see #6180
|
||||||
|
updatePlayBackElementsCurrentDuration(binding.playbackSeekBar.getMax());
|
||||||
|
|
||||||
showControls(500);
|
showControls(500);
|
||||||
animate(binding.currentDisplaySeek, false, 200, AnimationType.SCALE_AND_ALPHA);
|
animate(binding.currentDisplaySeek, false, 200, AnimationType.SCALE_AND_ALPHA);
|
||||||
binding.loadingPanel.setVisibility(View.GONE);
|
binding.loadingPanel.setVisibility(View.GONE);
|
||||||
|
@ -2590,6 +2590,18 @@ public final class Player implements
|
||||||
//////////////////////////////////////////////////////////////////////////*/
|
//////////////////////////////////////////////////////////////////////////*/
|
||||||
//region Playback position and seek
|
//region Playback position and seek
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the current duration into the corresponding elements.
|
||||||
|
* @param currentProgress
|
||||||
|
*/
|
||||||
|
private void updatePlayBackElementsCurrentDuration(final int currentProgress) {
|
||||||
|
// Don't set seekbar progress while user is seeking
|
||||||
|
if (currentState != STATE_PAUSED_SEEK) {
|
||||||
|
binding.playbackSeekBar.setProgress(currentProgress);
|
||||||
|
}
|
||||||
|
binding.playbackCurrentTime.setText(getTimeString(currentProgress));
|
||||||
|
}
|
||||||
|
|
||||||
@Override // own playback listener (this is a getter)
|
@Override // own playback listener (this is a getter)
|
||||||
public boolean isApproachingPlaybackEdge(final long timeToEndMillis) {
|
public boolean isApproachingPlaybackEdge(final long timeToEndMillis) {
|
||||||
// If live, then not near playback edge
|
// If live, then not near playback edge
|
||||||
|
|
Loading…
Reference in New Issue