Actually prevent uYou's playback from colliding with YouTube's
This commit is contained in:
@@ -10,9 +10,13 @@
|
|||||||
-(YTSingleVideoController *)activeVideo;
|
-(YTSingleVideoController *)activeVideo;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
// Prevent uYou player bar from showing when not playing downloaded media
|
|
||||||
@interface PlayerManager : NSObject
|
@interface PlayerManager : NSObject
|
||||||
|
// Prevent uYou player bar from showing when not playing downloaded media
|
||||||
- (float)progress;
|
- (float)progress;
|
||||||
|
// Prevent uYou's playback from colliding with YouTube's
|
||||||
|
- (void)setSource:(id)source;
|
||||||
|
- (void)pause;
|
||||||
|
+ (id)sharedInstance;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
// iOS 16 uYou crash fix - @level3tjg: https://github.com/qnblackcat/uYouPlus/pull/224
|
// iOS 16 uYou crash fix - @level3tjg: https://github.com/qnblackcat/uYouPlus/pull/224
|
||||||
|
|||||||
@@ -173,14 +173,17 @@ static void refreshUYouAppearance() {
|
|||||||
%end
|
%end
|
||||||
|
|
||||||
// Prevent uYou's playback from colliding with YouTube's
|
// Prevent uYou's playback from colliding with YouTube's
|
||||||
BOOL isYTPlaybackActive = NO;
|
%hook PlayerVC
|
||||||
%hook HAMPlayerInternal
|
- (void)close {
|
||||||
- (void)play { %orig; isYTPlaybackActive = YES; }
|
%orig;
|
||||||
- (void)terminate { %orig; isYTPlaybackActive = NO; }
|
[[%c(PlayerManager) sharedInstance] setSource:nil];
|
||||||
|
}
|
||||||
%end
|
%end
|
||||||
%hook PlayerManager
|
%hook HAMPlayerInternal
|
||||||
- (void)play {
|
- (void)play {
|
||||||
if (isYTPlaybackActive) return;
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[[%c(PlayerManager) sharedInstance] pause];
|
||||||
|
});
|
||||||
%orig;
|
%orig;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|||||||
Reference in New Issue
Block a user