Removed the wasPlaying variable
This commit is contained in:
parent
e5af1c93ae
commit
12796920a3
|
@ -216,7 +216,6 @@ public final class Player implements PlaybackListener, Listener {
|
||||||
// minimized to background but will resume automatically to the original player type
|
// minimized to background but will resume automatically to the original player type
|
||||||
private boolean isAudioOnly = false;
|
private boolean isAudioOnly = false;
|
||||||
private boolean isPrepared = false;
|
private boolean isPrepared = false;
|
||||||
private boolean wasPlaying = false;
|
|
||||||
|
|
||||||
/*//////////////////////////////////////////////////////////////////////////
|
/*//////////////////////////////////////////////////////////////////////////
|
||||||
// UIs, listeners and disposables
|
// UIs, listeners and disposables
|
||||||
|
@ -918,13 +917,6 @@ public final class Player implements PlaybackListener, Listener {
|
||||||
error -> Log.e(TAG, "Progress update failure: ", error));
|
error -> Log.e(TAG, "Progress update failure: ", error));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveWasPlaying() {
|
|
||||||
this.wasPlaying = getPlayWhenReady();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean wasPlaying() {
|
|
||||||
return wasPlaying;
|
|
||||||
}
|
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -86,8 +86,6 @@ public final class PlayerService extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!player.exoPlayerIsNull()) {
|
if (!player.exoPlayerIsNull()) {
|
||||||
player.saveWasPlaying();
|
|
||||||
|
|
||||||
// Releases wifi & cpu, disables keepScreenOn, etc.
|
// Releases wifi & cpu, disables keepScreenOn, etc.
|
||||||
// We can't just pause the player here because it will make transition
|
// We can't just pause the player here because it will make transition
|
||||||
// from one stream to a new stream not smooth
|
// from one stream to a new stream not smooth
|
||||||
|
|
|
@ -601,8 +601,6 @@ public abstract class VideoPlayerUi extends PlayerUi
|
||||||
player.changeState(STATE_PAUSED_SEEK);
|
player.changeState(STATE_PAUSED_SEEK);
|
||||||
}
|
}
|
||||||
|
|
||||||
player.saveWasPlaying();
|
|
||||||
|
|
||||||
showControls(0);
|
showControls(0);
|
||||||
animate(binding.currentDisplaySeek, true, DEFAULT_CONTROLS_DURATION,
|
animate(binding.currentDisplaySeek, true, DEFAULT_CONTROLS_DURATION,
|
||||||
AnimationType.SCALE_AND_ALPHA);
|
AnimationType.SCALE_AND_ALPHA);
|
||||||
|
@ -617,7 +615,7 @@ public abstract class VideoPlayerUi extends PlayerUi
|
||||||
}
|
}
|
||||||
|
|
||||||
player.seekTo(seekBar.getProgress());
|
player.seekTo(seekBar.getProgress());
|
||||||
if (player.wasPlaying() || player.getExoPlayer().getDuration() == seekBar.getProgress()) {
|
if (player.getExoPlayer().getDuration() == seekBar.getProgress()) {
|
||||||
player.getExoPlayer().play();
|
player.getExoPlayer().play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,10 +629,9 @@ public abstract class VideoPlayerUi extends PlayerUi
|
||||||
if (!player.isProgressLoopRunning()) {
|
if (!player.isProgressLoopRunning()) {
|
||||||
player.startProgressLoop();
|
player.startProgressLoop();
|
||||||
}
|
}
|
||||||
if (player.wasPlaying()) {
|
|
||||||
showControlsThenHide();
|
showControlsThenHide();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
|
|
||||||
|
@ -1168,8 +1165,6 @@ public abstract class VideoPlayerUi extends PlayerUi
|
||||||
binding.qualityTextView.setText(MediaFormat.getNameById(videoStream.getFormatId())
|
binding.qualityTextView.setText(MediaFormat.getNameById(videoStream.getFormatId())
|
||||||
+ " " + videoStream.getResolution());
|
+ " " + videoStream.getResolution());
|
||||||
}
|
}
|
||||||
|
|
||||||
player.saveWasPlaying();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue