Skip to content

Commit 367ece8

Browse files
authored
Merge pull request #9496 from Jared234/9437_continue_playing_while_seeking
Seeking no longer pauses the played video
2 parents 661cd4c + 1279692 commit 367ece8

3 files changed

Lines changed: 3 additions & 21 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ public final class Player implements PlaybackListener, Listener {
216216
// minimized to background but will resume automatically to the original player type
217217
private boolean isAudioOnly = false;
218218
private boolean isPrepared = false;
219-
private boolean wasPlaying = false;
220219

221220
/*//////////////////////////////////////////////////////////////////////////
222221
// UIs, listeners and disposables
@@ -918,13 +917,6 @@ private Disposable getProgressUpdateDisposable() {
918917
error -> Log.e(TAG, "Progress update failure: ", error));
919918
}
920919

921-
public void saveWasPlaying() {
922-
this.wasPlaying = getPlayWhenReady();
923-
}
924-
925-
public boolean wasPlaying() {
926-
return wasPlaying;
927-
}
928920
//endregion
929921

930922

app/src/main/java/org/schabi/newpipe/player/PlayerService.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ public void stopForImmediateReusing() {
8686
}
8787

8888
if (!player.exoPlayerIsNull()) {
89-
player.saveWasPlaying();
90-
9189
// Releases wifi & cpu, disables keepScreenOn, etc.
9290
// We can't just pause the player here because it will make transition
9391
// from one stream to a new stream not smooth

app/src/main/java/org/schabi/newpipe/player/ui/VideoPlayerUi.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,6 @@ public void onStartTrackingTouch(final SeekBar seekBar) {
618618
player.changeState(STATE_PAUSED_SEEK);
619619
}
620620

621-
player.saveWasPlaying();
622-
if (player.isPlaying()) {
623-
player.getExoPlayer().pause();
624-
}
625-
626621
showControls(0);
627622
animate(binding.currentDisplaySeek, true, DEFAULT_CONTROLS_DURATION,
628623
AnimationType.SCALE_AND_ALPHA);
@@ -637,7 +632,7 @@ public void onStopTrackingTouch(final SeekBar seekBar) {
637632
}
638633

639634
player.seekTo(seekBar.getProgress());
640-
if (player.wasPlaying() || player.getExoPlayer().getDuration() == seekBar.getProgress()) {
635+
if (player.getExoPlayer().getDuration() == seekBar.getProgress()) {
641636
player.getExoPlayer().play();
642637
}
643638

@@ -651,9 +646,8 @@ public void onStopTrackingTouch(final SeekBar seekBar) {
651646
if (!player.isProgressLoopRunning()) {
652647
player.startProgressLoop();
653648
}
654-
if (player.wasPlaying()) {
655-
showControlsThenHide();
656-
}
649+
650+
showControlsThenHide();
657651
}
658652
//endregion
659653

@@ -1188,8 +1182,6 @@ private void onQualityClicked() {
11881182
binding.qualityTextView.setText(MediaFormat.getNameById(videoStream.getFormatId())
11891183
+ " " + videoStream.getResolution());
11901184
}
1191-
1192-
player.saveWasPlaying();
11931185
}
11941186

11951187
/**

0 commit comments

Comments
 (0)