Merge pull request #9496 from Jared234/9437_continue_playing_while_seeking

Seeking no longer pauses the played video
This commit is contained in:
Stypox 2022-12-31 19:19:21 +01:00 committed by GitHub
commit 367ece8ffa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 21 deletions

View File

@ -216,7 +216,6 @@ public final class Player implements PlaybackListener, Listener {
// minimized to background but will resume automatically to the original player type
private boolean isAudioOnly = false;
private boolean isPrepared = false;
private boolean wasPlaying = false;
/*//////////////////////////////////////////////////////////////////////////
// UIs, listeners and disposables
@ -918,13 +917,6 @@ public final class Player implements PlaybackListener, Listener {
error -> Log.e(TAG, "Progress update failure: ", error));
}
public void saveWasPlaying() {
this.wasPlaying = getPlayWhenReady();
}
public boolean wasPlaying() {
return wasPlaying;
}
//endregion

View File

@ -86,8 +86,6 @@ public final class PlayerService extends Service {
}
if (!player.exoPlayerIsNull()) {
player.saveWasPlaying();
// Releases wifi & cpu, disables keepScreenOn, etc.
// We can't just pause the player here because it will make transition
// from one stream to a new stream not smooth

View File

@ -618,11 +618,6 @@ public abstract class VideoPlayerUi extends PlayerUi implements SeekBar.OnSeekBa
player.changeState(STATE_PAUSED_SEEK);
}
player.saveWasPlaying();
if (player.isPlaying()) {
player.getExoPlayer().pause();
}
showControls(0);
animate(binding.currentDisplaySeek, true, DEFAULT_CONTROLS_DURATION,
AnimationType.SCALE_AND_ALPHA);
@ -637,7 +632,7 @@ public abstract class VideoPlayerUi extends PlayerUi implements SeekBar.OnSeekBa
}
player.seekTo(seekBar.getProgress());
if (player.wasPlaying() || player.getExoPlayer().getDuration() == seekBar.getProgress()) {
if (player.getExoPlayer().getDuration() == seekBar.getProgress()) {
player.getExoPlayer().play();
}
@ -651,9 +646,8 @@ public abstract class VideoPlayerUi extends PlayerUi implements SeekBar.OnSeekBa
if (!player.isProgressLoopRunning()) {
player.startProgressLoop();
}
if (player.wasPlaying()) {
showControlsThenHide();
}
showControlsThenHide();
}
//endregion
@ -1188,8 +1182,6 @@ public abstract class VideoPlayerUi extends PlayerUi implements SeekBar.OnSeekBa
binding.qualityTextView.setText(MediaFormat.getNameById(videoStream.getFormatId())
+ " " + videoStream.getResolution());
}
player.saveWasPlaying();
}
/**