fix(youtube/minimized-playback): disable minimized playback for shorts (#371)

This commit is contained in:
LisoUseInAIKyrios 2023-04-27 17:38:52 +04:00 committed by GitHub
parent 9f8063880c
commit df4b03fed5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -1,16 +1,17 @@
package app.revanced.integrations.patches;
import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.shared.PlayerType;
public class MinimizedPlaybackPatch {
public static boolean isNotPlayingShorts(boolean isPipEnabled) {
return !PlayerType.getCurrent().isNoneOrHidden() && isPipEnabled;
public static boolean playbackIsNotShort() {
return !PlayerType.getCurrent().isNoneOrHidden();
}
public static boolean isMinimizedPlaybackEnabled() {
return SettingsEnum.ENABLE_MINIMIZED_PLAYBACK.getBoolean();
public static boolean overrideMinimizedPlaybackAvailable() {
// This could be done entirely in the patch,
// but having a unique method to search for makes manually inspecting the patched apk much easier.
return true;
}
}

View File

@ -111,7 +111,6 @@ public enum SettingsEnum {
CAPTIONS_ENABLED("revanced_autocaptions_enabled", BOOLEAN, FALSE),
DISABLE_ZOOM_HAPTICS("revanced_disable_zoom_haptics", BOOLEAN, TRUE),
ENABLE_EXTERNAL_BROWSER("revanced_enable_external_browser", BOOLEAN, TRUE, true),
ENABLE_MINIMIZED_PLAYBACK("revanced_enable_minimized_playback", BOOLEAN, TRUE),
PREFERRED_AUTO_REPEAT("revanced_pref_auto_repeat", BOOLEAN, FALSE),
TAP_SEEKING_ENABLED("revanced_enable_tap_seeking", BOOLEAN, TRUE),
USE_HDR_AUTO_BRIGHTNESS("revanced_pref_hdr_autobrightness", BOOLEAN, TRUE),