From 0cb27e4cc27ba9de07817ab2570bf28054761807 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Tue, 11 May 2021 21:40:40 +0200 Subject: [PATCH 1/2] Fixed player not automatically playing Should also fix https://github.com/TeamNewPipe/NewPipe/issues/6179 --- app/src/main/java/org/schabi/newpipe/player/Player.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index 21276b4c0f5..7d31dae7fbf 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -714,7 +714,11 @@ && isPlaybackResumeEnabled(this) // Android TV: without it focus will frame the whole player binding.playPauseButton.requestFocus(); - playPause(); + if (getPlayWhenReady()) { + play(); + } else { + pause(); + } } NavigationHelper.sendPlayerStartedEvent(context); } From 2e0846f778de7e0697bc9bc96c0d47684b53d89b Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Tue, 11 May 2021 22:11:16 +0200 Subject: [PATCH 2/2] Added comment --- app/src/main/java/org/schabi/newpipe/player/Player.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index 7d31dae7fbf..ba6521b91c5 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -714,6 +714,7 @@ && isPlaybackResumeEnabled(this) // Android TV: without it focus will frame the whole player binding.playPauseButton.requestFocus(); + // Note: This is for automatically playing (when "Resume playback" is off), see #6179 if (getPlayWhenReady()) { play(); } else {