Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#5263: Allow the user to pause while a video is buffering #5929

Merged
merged 5 commits into from
Mar 29, 2021
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