hello therealFoxstee! I recently tried using this for sideloading in my version of uYouPlus!(forked) but I had problems with it and tried building the ipa 8 times with it and all it says is this error from the tweak.
error: fell off the face of the planet when we found a '}'
I did try to fix it but removing a few bits of code will mess your wonderful tweak. I tried implementing it because my iPhone does play content in the notch.
and here’s the code I tried to implement. And it is a bit modified so it’ll work as a toggleable option in settings.
%group gDontEatMyContent
%hook YTPlayerViewController
- (void)viewDidAppear:(BOOL)animated {
YTPlayerView *playerView = [self playerView];
UIView *renderingViewContainer = MSHookIvar<UIView *>(playerView, "_renderingViewContainer");
renderingView = [playerView renderingView];
CGFloat constant = 23; // Make renderingView a bit larger since safe area has sizeable margins from the notch and side borders; tested on iPhone 13 mini
widthConstraint = [renderingView.widthAnchor constraintEqualToAnchor:renderingViewContainer.safeAreaLayoutGuide.widthAnchor constant:constant];
heightConstraint = [renderingView.heightAnchor constraintEqualToAnchor:renderingViewContainer.safeAreaLayoutGuide.heightAnchor constant:constant];
centerXConstraint = [renderingView.centerXAnchor constraintEqualToAnchor:renderingViewContainer.centerXAnchor];
centerYConstraint = [renderingView.centerYAnchor constraintEqualToAnchor:renderingViewContainer.centerYAnchor];
// playerView.backgroundColor = [UIColor greenColor];
// renderingViewContainer.backgroundColor = [UIColor redColor];
// renderingView.backgroundColor = [UIColor blueColor];
YTMainAppVideoPlayerOverlayViewController *activeVideoPlayerOverlay = [self activeVideoPlayerOverlay];
// Must check class since YTInlineMutedPlaybackPlayerOverlayViewController doesn't have -(BOOL)isFullscreen
if ([NSStringFromClass([activeVideoPlayerOverlay class]) isEqualToString:@"YTMainAppVideoPlayerOverlayViewController"] && [activeVideoPlayerOverlay isFullscreen]) {
activate();
} else {
center();
}
%orig(animated);
}
- (void)didPressToggleFullscreen {
YTMainAppVideoPlayerOverlayViewController *activeVideoPlayerOverlay = [self activeVideoPlayerOverlay];
if (![activeVideoPlayerOverlay isFullscreen]) // Entering fullscreen
activate();
else // Exiting fullscreen
deactivate();
%orig;
}
- (void)didSwipeToEnterFullscreen {
%orig; activate();
}
- (void)didSwipeToExitFullscreen {
%orig; deactivate();
}
- (void)singleVideo:(id)arg1 aspectRatioDidChange:(CGFloat)arg2 {
aspectRatio = arg2;
if (aspectRatio == 0.0) {
// App backgrounded
} else if (aspectRatio < THRESHOLD) {
deactivate();
} else {
activate();
}
%orig(arg1, arg2);
}
%end
%hook YTVideoZoomOverlayView
- (void)didRecognizePinch:(UIPinchGestureRecognizer *)pinchGestureRecognizer {
// %log((CGFloat) [pinchGestureRecognizer scale], (CGFloat) [pinchGestureRecognizer velocity]);
if ([pinchGestureRecognizer velocity] <= 0.0) { // >>Zoom out<<
zoomedToFill = false;
activate();
} else if ([pinchGestureRecognizer velocity] > 0.0) { // <<Zoom in>>
zoomedToFill = true;
deactivate();
}
%orig(pinchGestureRecognizer);
}
- (void)flashAndHideSnapIndicator {}
// https://github.com/lgariv/UniZoom/blob/master/Tweak.xm
- (void)setSnapIndicatorVisible:(bool)arg1 {
%orig(NO);
}
%end
%end