Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions app/src/main/java/org/schabi/newpipe/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -706,11 +706,7 @@ && isPlaybackResumeEnabled(this)
// Android TV: without it focus will frame the whole player
binding.playPauseButton.requestFocus();

if (simpleExoPlayer.getPlayWhenReady()) {
play();
} else {
pause();
}
playPause();
}
NavigationHelper.sendPlayerStartedEvent(context);
}
Expand Down Expand Up @@ -1687,7 +1683,7 @@ public void onStopTrackingTouch(final SeekBar seekBar) {
}

public void saveWasPlaying() {
this.wasPlaying = simpleExoPlayer.getPlayWhenReady();
this.wasPlaying = getPlayWhenReady();
}
//endregion

Expand Down Expand Up @@ -2686,7 +2682,7 @@ public void playPause() {
Log.d(TAG, "onPlayPause() called");
}

if (isPlaying()) {
if (getPlayWhenReady()) {
pause();
} else {
play();
Expand Down Expand Up @@ -4012,6 +4008,10 @@ public boolean isPlaying() {
return !exoPlayerIsNull() && simpleExoPlayer.isPlaying();
}

public boolean getPlayWhenReady() {
return !exoPlayerIsNull() && simpleExoPlayer.getPlayWhenReady();
}

private boolean isLoading() {
return !exoPlayerIsNull() && simpleExoPlayer.isLoading();
}
Expand Down