Code Monkey home page Code Monkey logo

donteatmycontent's Introduction

DontEatMyContent

Prevent the notch/Dynamic Island from munching on 2:1 video content in YouTube

How it works

The rendering view is constrained to the safe area layout guide of its container so it will always be below the notch and Dynamic Island (learn more). These constraints are only activated for videos with 2:1 aspect ratio or wider to prevent unintended effects on videos with smaller aspect ratios.

Compatibility

Runs on all devices on iOS/iPadOS 14.0 or later, though I wouldn't recommend enabling the tweak if the notch doesn't cut into your videos.

Grab it

Preview - iPhone 15 Pro

Default

Tweaked

Zoomed to fill

License

The MIT License

donteatmycontent's People

Contributors

balackburn avatar deci8belios avatar erspielthd avatar factzerdx avatar gototheskinny avatar hiepvk avatar olivertzeng avatar skeids avatar therealfoxster avatar thunderz2016 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

donteatmycontent's Issues

Crashing with YouTube 18.19.1 (sideloaded)

I've tried to add the latest release (1.0.8) to YouTube 18.19.1 with Sideloadly which leads to instant app crashes during launch.

For context, it's not YouTube vanilla as there are some other tweaks injected as well, see the list of other tweaks here on AppDB.

Issue with Ambient Mode

Hi,

Recently found that a YouTube update internally made it so that ambient mode shows on the sides of videos that are widescreen, which looks fine wit DontEatMyContent disabled, but with it enabled, it causes this effect:
image
image

On the tops and bottoms, there are black bars that are not the colors of the ambient mode as it seems. Maybe a feature to enable or disable the ambient mode behavior during playback would help to resolve the issue? I personally am not sure if it'd look better with ambient mode on the tops and bottoms or not, instead of all black around.

Thanks.

Full screen notch

So I recently upgraded you plus and before I had those setting disabled and enabled to see the difference now when I do so I no longer see the difference

Issue with Fullscreen Zoom

Hi again,

Just wanted to also put this here so you were aware, there is a weird jittery/glitchy behavior when using DontEatMyContent in fullscreen.

trim.58EC974C-6F32-4A53-8B3E-7115046026E1.MOV

It's very possible that this is an incompatibility with UYouPlus++'s "Disable Pinch to Zoom" function, as when disabled, the behavior corrects itself.

image

Not sure if there's anything on your side to fix, but just figured I'd let you know of it. I'll also report this on their repo and see what they have to say.
Thanks again.

[v1.1.1] Dynamic Island needs fixing

On iphone14pm, if playing a clip, dynamic island always works while watching the clip. And if it's on YouTube, you won't be able to click to watch the clip via dynamic island.

Dynamic Island still cutting into video

#4 already exists, but no information was given about what that issue actually was and then it was closed.

On the iPhone 14 Pro the Dynamic Island still cuts into the video. I have sideloaded the tweak with uYouPlus, the provided AltStore IPA, and injecting it manually with no success.

Opening YouTube's settings panel crashes the Application

YouTube changed the behaviour of their settings panel in 19.03.2 which leads to crashes when using incompatible tweaks. Some developers (mainly user:poomsmart) published their way of fixing the issue on their repositories, maybe it helps to look into it.

Thanks in advance, have a good one!

Does DontEatMyContent support Sideloading? [Error Problems?]

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.
43BEFCAA-004F-41FA-88EC-408D1710501B
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

Breaks YT Zoom

In a recent update to Youtube, a zoom feature was added.
You can pinch with two fingers to enable it

In YouUPlus on ios with the DontEatMyContent tweak enables it breaks the zoom functionality

Ability to Hide Channel Watermark

Hello theRealFoxster! Was wondering if you want to add an option that hides the channel watermark. This can be great for DontEatMyContent if the watermark can be an annoyance and I already know the tweaks from uYouPlus/uYouEnhanced have that option but sadly they no longer work on the latest YouTube version because of the removal of YTAnnotationsViewController
and I did try to use stuff like YTIElementRenderer but when I did that it broke the tapping functionality in the video player if a video had a watermark. But then I tried YTMainAppVideoPlayerOverlayView and it worked but if you went into a different app and hop back on YouTube it will reappear. So what are your thoughts on this option?

%hook YTAnnotationsViewController // Deprecated - YouTube v18.30+
- (void)loadFeaturedChannelWatermark {
    if (IsEnabled(@"hideChannelWatermark_enabled")) {}
    else { return %orig; }
}
%end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.