Add toggle to fix casting

This commit is contained in:
Bryce Hackel 2024-05-11 01:44:26 -07:00
parent d893db366a
commit 540de2865f
No known key found for this signature in database
GPG key ID: F031960F08455E88
2 changed files with 20 additions and 0 deletions

View file

@ -279,6 +279,18 @@ NSData *cellDividerData;
- (BOOL)enableModularPlayerBarController { return NO; } // fixes some of the iSponorBlock problems
%end
// Fix Casting: https://github.com/arichornlover/uYouEnhanced/issues/606#issuecomment-2098289942
%group gFixCasting
%hook YTColdConfig
- (BOOL)cxClientEnableIosLocalNetworkPermissionReliabilityFixes { return YES; }
- (BOOL)cxClientEnableIosLocalNetworkPermissionUsingSockets { return NO; }
- (BOOL)cxClientEnableIosLocalNetworkPermissionWifiFixes { return YES; }
%end
%hook YTHotConfig
- (BOOL)isPromptForLocalNetworkPermissionsEnabled { return YES; }
%end
%end
// NOYTPremium - https://github.com/PoomSmart/NoYTPremium/
%hook YTCommerceEventGroupHandler
- (void)addEventHandlers {}
@ -1665,6 +1677,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
if (IS_ENABLED(@"hideDoubleTapToSeekOverlay_enabled")) {
%init(gHideDoubleTapToSeekOverlay);
}
if (IS_ENABLED(@"fixCasting_enabled")) {
%init(gFixCasting);
}
// YTNoModernUI - @arichorn
BOOL ytNoModernUIEnabled = IS_ENABLED(@"ytNoModernUI_enabled");
@ -1719,4 +1734,8 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
if (![allKeys containsObject:@"showPlaybackRate"]) {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"showPlaybackRate"];
}
// Set video casting fix default to enabled
if (![allKeys containsObject:@"fixCasting_enabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"fixCasting_enabled"];
}
}

View file

@ -1155,6 +1155,7 @@ extern NSBundle *uYouPlusBundle();
SWITCH_ITEM2(LOC(@"NEW_MINIPLAYER_STYLE"), LOC(@"NEW_MINIPLAYER_STYLE_DESC"), @"bigYTMiniPlayer_enabled");
SWITCH_ITEM2(LOC(@"YT_RE_EXPLORE"), LOC(@"YT_RE_EXPLORE_DESC"), @"reExplore_enabled");
SWITCH_ITEM2(LOC(@"Hide Indicators"), LOC(@"Hides all Indicators that were in the App."), @"hideSubscriptionsNotificationBadge_enabled");
SWITCH_ITEM2(LOC(@"Fix Casting"), LOC(@"Changes a few A/B flags to fix casting"), @"fixCasting_enabled");
SWITCH_ITEM(LOC(@"ENABLE_FLEX"), LOC(@"ENABLE_FLEX_DESC"), @"flex_enabled");
if ([settingsViewController respondsToSelector:@selector(setSectionItems:forCategory:title:icon:titleDescription:headerHidden:)])