Skip to content
This repository was archived by the owner on Oct 26, 2024. It is now read-only.

Commit 1dd84a3

Browse files
committed
fix(youtube/minimized-playback): disable when playing shorts
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
1 parent 512d747 commit 1dd84a3

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

app/src/main/java/app/revanced/integrations/patches/MinimizedPlaybackPatch.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package app.revanced.integrations.patches;
22

33
import app.revanced.integrations.settings.SettingsEnum;
4+
import app.revanced.integrations.shared.PlayerType;
45

56
public class MinimizedPlaybackPatch {
67

8+
public static boolean isNotPlayingShorts(boolean isPipEnabled) {
9+
return !PlayerType.getCurrent().isNoneOrHidden() && isPipEnabled;
10+
}
11+
712
public static boolean isMinimizedPlaybackEnabled() {
813
return SettingsEnum.ENABLE_MINIMIZED_PLAYBACK.getBoolean();
914
}

app/src/main/java/app/revanced/integrations/shared/PlayerType.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,11 @@ enum class PlayerType {
4949
*/
5050
val onChange = Event<PlayerType>()
5151
}
52+
53+
/**
54+
* Weather Shorts are being played.
55+
*/
56+
fun isNoneOrHidden(): Boolean {
57+
return this == NONE || this == HIDDEN
58+
}
5259
}

0 commit comments

Comments
 (0)