From 376ec3ed12d33761ee5e1fb61862f0960edc9e60 Mon Sep 17 00:00:00 2001 From: Balackburn Date: Mon, 5 Feb 2024 11:00:05 +0100 Subject: [PATCH] Updated YTSpeed --- YTLitePlus.xm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/YTLitePlus.xm b/YTLitePlus.xm index a57abca..328c2ef 100644 --- a/YTLitePlus.xm +++ b/YTLitePlus.xm @@ -386,15 +386,15 @@ static BOOL IsEnabled(NSString *key) { %end %end -// YTSpeed - https://github.com/Lyvendia/YTSpeed (Only works on YouTube v16.05.7-v18.18.2) +// YTSpeed - https://github.com/Lyvendia/YTSpeed %group gYTSpeed %hook YTVarispeedSwitchController - (id)init { id result = %orig; const int size = 17; - float speeds[] = {0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 5.0}; - id varispeedSwitchControllerOptions[size]; + float speeds[] = {0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 5.0}; + id varispeedSwitchControllerOptions[size]; for (int i = 0; i < size; ++i) { id title = [NSString stringWithFormat:@"%.2fx", speeds[i]]; @@ -411,12 +411,12 @@ static BOOL IsEnabled(NSString *key) { %hook MLHAMQueuePlayer - (void)setRate:(float)rate { - MSHookIvar(self, "_rate") = rate; + MSHookIvar(self, "_rate") = rate; MSHookIvar(self, "_preferredRate") = rate; id player = MSHookIvar(self, "_player"); [player setRate: rate]; - + id stickySettings = MSHookIvar(self, "_stickySettings"); [stickySettings setRate: rate]; @@ -425,7 +425,7 @@ static BOOL IsEnabled(NSString *key) { YTSingleVideoController *singleVideoController = self.delegate; [singleVideoController playerRateDidChange: rate]; } -%end +%end %hook YTPlayerViewController %property (nonatomic, assign) float playbackRate;