Skip to content

Commit 2ed675c

Browse files
fix(YouTube - Remove background playback restrictions): Do not show media controls when playing Shorts from the feed
1 parent 8503013 commit 2ed675c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/BackgroundPlaybackPatch.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package app.revanced.extension.youtube.patches;
22

33
import app.revanced.extension.youtube.settings.Settings;
4+
import app.revanced.extension.youtube.shared.PlayerType;
45
import app.revanced.extension.youtube.shared.ShortsPlayerState;
56

67
@SuppressWarnings("unused")
@@ -23,7 +24,13 @@ public static boolean isBackgroundPlaybackAllowed(boolean original) {
2324
// 7. Close the Short
2425
// 8. Resume playing the regular video
2526
// 9. Minimize the app (PIP should appear)
26-
return !ShortsPlayerState.isOpen();
27+
if (ShortsPlayerState.isOpen()) {
28+
return false;
29+
}
30+
31+
// Check if the video player is opened and it's not playing in the feed.
32+
PlayerType current = PlayerType.getCurrent();
33+
return !current.isNoneOrHidden() && current != PlayerType.INLINE_MINIMAL;
2734
}
2835

2936
/**

0 commit comments

Comments
 (0)