Add disable ambient mode

This commit is contained in:
Bryce Hackel 2024-07-07 03:25:47 -07:00
parent e2c526e2ba
commit 48eb1cacd1
No known key found for this signature in database
GPG key ID: F031960F08455E88
17 changed files with 108 additions and 22 deletions

View file

@ -117,6 +117,8 @@ static const NSInteger YTLiteSection = 789;
BASIC_SWITCH(LOC(@"HIDE_SHADOW_OVERLAY_BUTTONS"), LOC(@"HIDE_SHADOW_OVERLAY_BUTTONS_DESC"), @"hideVideoPlayerShadowOverlayButtons_enabled"),
BASIC_SWITCH(LOC(@"HIDE_RIGHT_PANEL"), LOC(@"HIDE_RIGHT_PANEL_DESC"), @"hideRightPanel_enabled"),
BASIC_SWITCH(LOC(@"HIDE_HEATWAVES"), LOC(@"HIDE_HEATWAVES_DESC"), @"hideHeatwaves_enabled"),
BASIC_SWITCH(LOC(@"DISABLE_AMBIENT_PORTRAIT"), LOC(@"DISABLE_AMBIENT_PORTRAIT_DESC"), @"disableAmbientModePortrait_enabled"),
BASIC_SWITCH(LOC(@"DISABLE_AMBIENT_FULLSCREEN"), LOC(@"DISABLE_AMBIENT_FULLSCREEN_DESC"), @"disableAmbientModeFullscreen_enabled"),
BASIC_SWITCH(LOC(@"SEEK_ANYWHERE"), LOC(@"SEEK_ANYWHERE_DESC"), @"seekAnywhere_enabled"),
BASIC_SWITCH(LOC(@"ENABLE_TAP_TO_SEEK"), LOC(@"ENABLE_TAP_TO_SEEK_DESC"), @"YTTapToSeek_enabled"),
BASIC_SWITCH(LOC(@"DISABLE_PULL_TO_FULLSCREEN_GESTURE"), LOC(@"DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC"), @"disablePullToFull_enabled"),

@ -1 +1 @@
Subproject commit 2f411967bfe9f7b74ed58256b34992f132207d4c
Subproject commit 07bb69b0285863d01c613371cd4f33d8b374f59d

View file

@ -38,6 +38,7 @@
#import "Tweaks/YouTubeHeader/YTWatchViewController.h"
#import "Tweaks/YouTubeHeader/YTWatchPullToFullController.h"
#import "Tweaks/YouTubeHeader/YTPlayerBarController.h"
#import "Tweaks/YouTubeHeader/YTResponder.h"
#define LOC(x) [tweakBundle localizedStringForKey:x value:nil table:nil]
#define YT_BUNDLE_ID @"com.google.ios.youtube"
@ -104,6 +105,16 @@
- (void)resetViewControllersCache;
@end
// Disable ambient mode - @bhackel
@interface YTWatchViewController (YTLitePlus) <YTResponder>
@property (nonatomic, assign, readwrite, getter=isFullscreen) BOOL fullscreen;
@end
@interface YTWatchCinematicContainerController : NSObject
@property id <YTResponder> parentResponder;
@end
// SponsorBlock button in Nav bar
@interface MDCButton : UIButton
@end

View file

@ -336,24 +336,6 @@ BOOL isTabSelected = NO;
%end
%end
%group gDisableAmbientMode
%hook YTColdConfig
- (BOOL)disableCinematicForLowPowerMode { return NO; }
- (BOOL)enableCinematicContainer { return NO; }
- (BOOL)enableCinematicContainerOnClient { return NO; }
- (BOOL)enableCinematicContainerOnTablet { return NO; }
- (BOOL)enableTurnOffCinematicForFrameWithBlackBars { return YES; }
- (BOOL)enableTurnOffCinematicForVideoWithBlackBars { return YES; }
- (BOOL)iosCinematicContainerClientImprovement { return NO; }
- (BOOL)iosEnableGhostCardInlineTitleCinematicContainerFix { return NO; }
- (BOOL)iosUseFineScrubberMosaicStoreForCinematic { return NO; }
- (BOOL)mainAppCoreClientEnableClientCinematicPlaylists { return NO; }
- (BOOL)mainAppCoreClientEnableClientCinematicPlaylistsPostMvp { return NO; }
- (BOOL)mainAppCoreClientEnableClientCinematicTablets { return NO; }
- (BOOL)iosEnableFullScreenAmbientMode { return NO; }
%end
%end
// Hide YouTube Heatwaves in Video Player (YouTube v17.19.2-present) - @level3tjg - https://www.reddit.com/r/jailbreak/comments/v29yvk/
%group gHideHeatwaves
%hook YTInlinePlayerBarContainerView
@ -499,6 +481,22 @@ BOOL isTabSelected = NO;
}
%end
// Disable Ambient Mode - @bhackel
%hook YTWatchCinematicContainerController
- (BOOL)isCinematicLightingAvailable {
// Check if we are in fullscreen or not, then decide if ambient is disabled
YTWatchViewController *watchViewController = (YTWatchViewController *) self.parentResponder;
BOOL isFullscreen = watchViewController.fullscreen;
if (IsEnabled(@"disableAmbientModePortrait_enabled") && !isFullscreen) {
return NO;
}
if (IsEnabled(@"disableAmbientModeFullscreen_enabled") && isFullscreen) {
return NO;
}
return %orig;
}
%end
// BigYTMiniPlayer: https://github.com/Galactic-Dev/BigYTMiniPlayer
%group Main
%hook YTWatchMiniBarView
@ -660,9 +658,6 @@ BOOL isTabSelected = NO;
if (IsEnabled(@"ytNoModernUI_enabled")) {
%init(gYTNoModernUI);
}
if (IsEnabled(@"disableAmbientMode_enabled")) {
%init(gDisableAmbientMode);
}
if (IsEnabled(@"disableAccountSection_enabled")) {
%init(gDisableAccountSection);
}

View file

@ -20,6 +20,12 @@
"HIDE_HEATWAVES" = "إخفاء موجات الحر";
"HIDE_HEATWAVES_DESC" = "يخفي موجات الحر في مشغل الفيديو. مطلوب إعادة تشغيل التطبيق.";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -20,6 +20,12 @@
"HIDE_HEATWAVES" = "Hitzewellen ausblenden";
"HIDE_HEATWAVES_DESC" = "Versteckt die Hitzewellen im Videoplayer. Ein Neustart der App ist erforderlich.";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -20,6 +20,12 @@
"HIDE_HEATWAVES" = "Hide Heatwaves";
"HIDE_HEATWAVES_DESC" = "Hides the Heatwaves in the video player. App restart is required.";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -20,6 +20,12 @@
"HIDE_HEATWAVES" = "Ocultar Heatwaves";
"HIDE_HEATWAVES_DESC" = "Oculta las Heatwaves en el reproductor de vídeo. Es necesario reiniciar la aplicación.";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -20,6 +20,12 @@
"HIDE_HEATWAVES" = "Masquer les Heatwaves";
"HIDE_HEATWAVES_DESC" = "Masque les Heatwaves dans le lecteur vidéo. Le redémarrage de l'application est requis.";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -20,6 +20,12 @@
"HIDE_HEATWAVES" = "ヒートウェーブを非表示";
"HIDE_HEATWAVES_DESC" = "動画プレーヤーのヒートウェーブを非表示にします。アプリの再起動が必要です。";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -20,6 +20,12 @@
"HIDE_HEATWAVES" = "Hide Heatwaves";
"HIDE_HEATWAVES_DESC" = "Hides the Heatwaves in the video player. App restart is required.";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -20,6 +20,12 @@
"HIDE_HEATWAVES" = "Ascunde Heatwaves";
"HIDE_HEATWAVES_DESC" = "Ascundere Heatwaves în player-ul video. Este necesară repornirea aplicației.";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -20,6 +20,12 @@
"HIDE_HEATWAVES" = "Hide Heatwaves";
"HIDE_HEATWAVES_DESC" = "Hides the Heatwaves in the video player. App restart is required.";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -35,6 +35,12 @@ https://github.com/PoomSmart/Return-YouTube-Dislikes/tree/main/layout/Library/Ap
"HIDE_HEATWAVES" = "Hide Heatwaves";
"HIDE_HEATWAVES_DESC" = "Hides the Heatwaves in the video player. App restart is required.";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -20,6 +20,12 @@
"HIDE_HEATWAVES" = "Hide Heatwaves";
"HIDE_HEATWAVES_DESC" = "Hides the Heatwaves in the video player. App restart is required.";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -29,6 +29,12 @@
"HIDE_HEATWAVES" = "Ẩn sóng nhiệt";
"HIDE_HEATWAVES_DESC" = "Ẩn Sóng nhiệt trong trình phát video. Khởi động lại ứng dụng là bắt buộc.";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";

View file

@ -21,6 +21,12 @@
"HIDE_HEATWAVES" = "隱藏熱浪";
"HIDE_HEATWAVES_DESC" = "在播放器中隱藏熱浪";
"DISABLE_AMBIENT_PORTRAIT" = "Disable Ambient Mode (Portrait)";
"DISABLE_AMBIENT_PORTRAIT_DESC" = "Disable lighting surrounding video title";
"DISABLE_AMBIENT_FULLSCREEN" = "Disable Ambient Mode (Fullscreen)";
"DISABLE_AMBIENT_FULLSCREEN_DESC" = "Disable lighting surrouding video player";
"SEEK_ANYWHERE" = "Seek Anywhere Gesture";
"SEEK_ANYWHERE_DESC" = "Hold and drag on the video player to seek. You must disable YTLite - Hold to speed";