Skip to content

Commit 1279692

Browse files
committed
Removed the wasPlaying variable
1 parent e5af1c9 commit 1279692

3 files changed

Lines changed: 3 additions & 18 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 & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,6 @@ public void onStartTrackingTouch(final SeekBar seekBar) {
601601
player.changeState(STATE_PAUSED_SEEK);
602602
}
603603

604-
player.saveWasPlaying();
605-
606604
showControls(0);
607605
animate(binding.currentDisplaySeek, true, DEFAULT_CONTROLS_DURATION,
608606
AnimationType.SCALE_AND_ALPHA);
@@ -617,7 +615,7 @@ public void onStopTrackingTouch(final SeekBar seekBar) {
617615
}
618616

619617
player.seekTo(seekBar.getProgress());
620-
if (player.wasPlaying() || player.getExoPlayer().getDuration() == seekBar.getProgress()) {
618+
if (player.getExoPlayer().getDuration() == seekBar.getProgress()) {
621619
player.getExoPlayer().play();
622620
}
623621

@@ -631,9 +629,8 @@ public void onStopTrackingTouch(final SeekBar seekBar) {
631629
if (!player.isProgressLoopRunning()) {
632630
player.startProgressLoop();
633631
}
634-
if (player.wasPlaying()) {
635-
showControlsThenHide();
636-
}
632+
633+
showControlsThenHide();
637634
}
638635
//endregion
639636

@@ -1168,8 +1165,6 @@ private void onQualityClicked() {
11681165
binding.qualityTextView.setText(MediaFormat.getNameById(videoStream.getFormatId())
11691166
+ " " + videoStream.getResolution());
11701167
}
1171-
1172-
player.saveWasPlaying();
11731168
}
11741169

11751170
/**

0 commit comments

Comments
 (0)