Removed the wasPlaying variable

pull/9496/head
Jared Fantaye 2022-12-10 21:56:04 +01:00
rodzic e5af1c93ae
commit 12796920a3
3 zmienionych plików z 3 dodań i 18 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -601,8 +601,6 @@ public abstract class VideoPlayerUi extends PlayerUi
player.changeState(STATE_PAUSED_SEEK);
}
player.saveWasPlaying();
showControls(0);
animate(binding.currentDisplaySeek, true, DEFAULT_CONTROLS_DURATION,
AnimationType.SCALE_AND_ALPHA);
@ -617,7 +615,7 @@ public abstract class VideoPlayerUi extends PlayerUi
}
player.seekTo(seekBar.getProgress());
if (player.wasPlaying() || player.getExoPlayer().getDuration() == seekBar.getProgress()) {
if (player.getExoPlayer().getDuration() == seekBar.getProgress()) {
player.getExoPlayer().play();
}
@ -631,9 +629,8 @@ public abstract class VideoPlayerUi extends PlayerUi
if (!player.isProgressLoopRunning()) {
player.startProgressLoop();
}
if (player.wasPlaying()) {
showControlsThenHide();
}
showControlsThenHide();
}
//endregion
@ -1168,8 +1165,6 @@ public abstract class VideoPlayerUi extends PlayerUi
binding.qualityTextView.setText(MediaFormat.getNameById(videoStream.getFormatId())
+ " " + videoStream.getResolution());
}
player.saveWasPlaying();
}
/**