Fixes uYou crash when trying to play video (#1422) (#1428)

This commit is contained in:
Dan
2024-04-24 06:56:40 +07:00
committed by GitHub
parent 4fcb13d3aa
commit 076967ab94
+27
View File
@@ -325,6 +325,33 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
}
%end
// Fixes uYou crash when trying to play video (#1422)
@interface YTVarispeedSwitchController : NSObject
@end
@interface YTPlayerOverlayManager : NSObject
@property (nonatomic, assign) float currentPlaybackRate;
@property (nonatomic, strong, readonly) YTVarispeedSwitchController *varispeedController;
- (void)varispeedSwitchController:(YTVarispeedSwitchController *)varispeed didSelectRate:(float)rate;
- (void)setCurrentPlaybackRate:(float)rate;
- (void)setPlaybackRate:(float)rate;
@end
%hook YTPlayerOverlayManager
%property (nonatomic, assign) float currentPlaybackRate;
%new
- (void)setCurrentPlaybackRate:(float)rate {
[self varispeedSwitchController:self.varispeedController didSelectRate:rate];
}
%new
- (void)setPlaybackRate:(float)rate {
[self varispeedSwitchController:self.varispeedController didSelectRate:rate];
}
%end
// Hide search ads by @PoomSmart - https://github.com/PoomSmart/YouTube-X
// %hook YTIElementRenderer
// - (NSData *)elementData {