From 41faf70da15dd9b71e8854999b100ffd06e78954 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 17 Jan 2022 20:52:07 +0100 Subject: [PATCH] Workaround: Set recovery before switching player Quick fix --- .../newpipe/fragments/detail/VideoDetailFragment.java | 8 ++++++++ app/src/main/java/org/schabi/newpipe/player/Player.java | 1 + 2 files changed, 9 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index 25b87ed6f..05630ef79 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -1098,6 +1098,11 @@ public final class VideoDetailFragment toggleFullscreenIfInFullscreenMode(); + if (isPlayerAvailable()) { + // FIXME Workaround #7427 + player.setRecovery(); + } + if (!useExternalAudioPlayer) { openNormalBackgroundPlayer(append); } else { @@ -1114,6 +1119,9 @@ public final class VideoDetailFragment // See UI changes while remote playQueue changes if (!isPlayerAvailable()) { playerHolder.startService(false, this); + } else { + // FIXME Workaround #7427 + player.setRecovery(); } toggleFullscreenIfInFullscreenMode(); 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 c038f5573..81ef25db1 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -635,6 +635,7 @@ public final class Player implements final boolean isMuted = intent.getBooleanExtra(IS_MUTED, isMuted()); /* + * TODO As seen in #7427 this does not work: * There are 3 situations when playback shouldn't be started from scratch (zero timestamp): * 1. User pressed on a timestamp link and the same video should be rewound to the timestamp * 2. User changed a player from, for example. main to popup, or from audio to main, etc