From b594765d69e08b46d57f2b8a2c9a005ab5af7f5f Mon Sep 17 00:00:00 2001 From: Foxster Date: Mon, 25 Dec 2023 17:17:09 -0800 Subject: [PATCH] Prevent uYou's playback from colliding with YouTube's --- Sources/uYouPlusPatches.xm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Sources/uYouPlusPatches.xm b/Sources/uYouPlusPatches.xm index d05f611..9926bd4 100644 --- a/Sources/uYouPlusPatches.xm +++ b/Sources/uYouPlusPatches.xm @@ -159,6 +159,19 @@ static void refreshUYouAppearance() { } %end +// Prevent uYou's playback from colliding with YouTube's +BOOL isYTPlaybackActive = NO; +%hook HAMPlayerInternal +- (void)play { %orig; isYTPlaybackActive = YES; } +- (void)terminate { %orig; isYTPlaybackActive = NO; } +%end +%hook PlayerManager +- (void)play { + if (isYTPlaybackActive) return; + %orig; +} +%end + %ctor { %init; if (@available(iOS 16, *)) {