mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-04-30 06:34:37 +02:00
fix(YouTube - Remove background playback restrictions): Media controls appear in the status bar when playing Shorts from the feed
This commit is contained in:
parent
b8f3917b55
commit
79f933dad4
@ -2,6 +2,7 @@ package app.revanced.extension.youtube.patches.misc;
|
||||
|
||||
import app.revanced.extension.shared.settings.BooleanSetting;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.youtube.shared.PlayerType;
|
||||
import app.revanced.extension.youtube.shared.ShortsPlayerState;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@ -14,7 +15,16 @@ public class BackgroundPlaybackPatch {
|
||||
*/
|
||||
public static boolean isBackgroundPlaybackAllowed(boolean original) {
|
||||
if (original) return true;
|
||||
return ShortsPlayerState.getCurrent().isClosed();
|
||||
return ShortsPlayerState.getCurrent().isClosed() &&
|
||||
// 1. Shorts background playback is enabled.
|
||||
// 2. Autoplay in feed is turned on.
|
||||
// 3. Play Shorts from feed.
|
||||
// 4. Media controls appear in status bar.
|
||||
// (For unpatched YouTube with Premium accounts, media controls do not appear in the status bar)
|
||||
//
|
||||
// This is just a visual bug and does not affect Shorts background play in any way.
|
||||
// To fix this, just check PlayerType.
|
||||
PlayerType.getCurrent() != PlayerType.INLINE_MINIMAL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user