fix hide next & previous button not working sometimes

This commit is contained in:
qnblackcat 2022-06-14 11:06:17 +07:00
parent 57ed260959
commit 349a49eb93

View file

@ -86,11 +86,14 @@ BOOL ytMiniPlayer() {
if (hideAutoplaySwitch()) {}
else { return %orig; }
}
- (void)layoutSubviews {
- (void)layoutSubviews { // hide Next & Previous button
%orig;
if (hidePreviousAndNextButton()) { // hide Next & Previous button
if (hidePreviousAndNextButton()) {
MSHookIvar<YTMainAppControlsOverlayView *>(self, "_nextButton").hidden = YES;
MSHookIvar<YTMainAppControlsOverlayView *>(self, "_previousButton").hidden = YES;
MSHookIvar<YTMainAppControlsOverlayView *>(self, "_previousButton").hidden = YES;
// YouTube love beta testing :/
MSHookIvar<YTTransportControlsButtonView *>(self, "_nextButtonView").hidden = YES;
MSHookIvar<YTTransportControlsButtonView *>(self, "_previousButtonView").hidden = YES;
}
}
%end