diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 6c4b1cb..14f4405 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -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 *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 *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"]; + } } diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index 40017f1..751fad8 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -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:)])