[Request] Option to remove “share” “remix” “thanks” etc under the video player #404

Open
opened 2024-09-04 12:51:21 +00:00 by garshmo · 5 comments
garshmo commented 2024-09-04 12:51:21 +00:00 (Migrated from github.com)

Is there an existing issue for this?

  • I have searched the existing issues

Do you use YouTube Premium?

No, I don't use YouTube Premium

My feature request

The ability to remove the buttons under the video player, I believe it was an option in some of the builds from last year but it went away at some point
IMG_2916

Additional context

No response

### Is there an existing issue for this? - [X] I have searched the existing issues ### Do you use YouTube Premium? ❌ No, I don't use YouTube Premium ### My feature request The ability to remove the buttons under the video player, I believe it was an option in some of the builds from last year but it went away at some point ![IMG_2916](https://github.com/user-attachments/assets/2fe84d18-5f9b-41d7-9a0d-2b4d2c470df8) ### Additional context _No response_
bhackel commented 2024-09-04 21:12:04 +00:00 (Migrated from github.com)

I’ve looked into removing it in the past, and it is tricky. I may work on it some time in the future.

I’ve looked into removing it in the past, and it is tricky. I may work on it some time in the future.
eliliam commented 2024-09-06 16:41:01 +00:00 (Migrated from github.com)

@bhackel I'd love to hear a bit more about what makes things like this difficult or easy, could you elaborate a bit? The whole concept of modified YouTube IPAs are kind of black magic to most of us who use it

@bhackel I'd love to hear a bit more about what makes things like this difficult or easy, could you elaborate a bit? The whole concept of modified YouTube IPAs are kind of black magic to most of us who use it
bhackel commented 2024-09-06 17:59:42 +00:00 (Migrated from github.com)

Sure thing. I am hoping to make a tweak development guide in the near future, so this can be a good starting point.

Let’s say that I wanted to hide this play button. Using FLEX (which you can enable in YTLitePlus settings), we can select the element to inspect it further.

IMG_1684

The next step after finding the class name of the object (YTPlaybackButton) is to find a specific characteristic of this object that makes it unique. This is because when we are hooking this class, we only want to hide the button in this specific case, but not other cases. We can see other cases by using FLEX - Menu - Heap Objects - search for YTPlaybackButton.

IMG_1690

Let’s check what the other YTPlaybackButton object is for.

IMG_1691

As you can see here, it is used for the minibar. We do not want to hide the minibar play button, so we need to find a unique characteristic of the player’s playback button object that we can use to filter it.

Going back to our YTPlaybackButton object, a generally good technique for the first step in uniqueness is checking the accessibilityIdentifier property. This is something that all objects have, and if it is set by the YouTube developers properly, then it is a unique identifier for this specific object.

IMG_1694

We can see here that it does indeed have an accessibilityIdentifier.

Another property that all objects have is hidden. We can use this to hide an object easily.

IMG_1686

Then we can write our hook like this:

%hook YTPlaybackButton
- (void)layoutSubviews {
    %orig;
    if ([self.accessibilityIdentifier isEqualToString:@“id.player.play.button]) {
        self.hidden = YES;
    }
}
%end

The layoutSubviews method is an easy method to hook because it is called any time that a view, like this button, changes state in any way.

One of the things I struggled with early on was the syntax of objective-c. It isn’t like Python, Java, Javascript, C, C++ or any other language that I have seen before. ChatGPT was a big help in understanding how to write in the language early on. I will try translating it into Python and Java since these are languages that I think are closest to it

%hook YTPlaybackButton
def layoutSubviews(): -> None
    %orig
    if self.accessibilityIdentifier == id.player.play.button:
        self.hidden = True
%hook YTPlaybackButton
void layoutSubviews() {
    %orig;
    if (self.accessibilityIdentifier.isEqual(id.player.play.button) {
        self.hidden = true;
    }
}

——————————————————

Next, let’s say we wanted to remove the buttons under the player. We can use FLEX to figure out what class types they are.

IMG_1696

Now we can check for a unique identifier like before

IMG_1697

Let’s say we did the same thing as before and hid this element. The result would look like this

IMG_1698

This is not a desirable effect. There is an empty space between the buttons. Therefore, we would need to do something more complicated to block the element from being added at all, rather than hiding the element after it has been added.

I won’t get into the details now, but that is the general idea.

Sure thing. I am hoping to make a tweak development guide in the near future, so this can be a good starting point. Let’s say that I wanted to hide this play button. Using FLEX (which you can enable in YTLitePlus settings), we can select the element to inspect it further. ![IMG_1684](https://github.com/user-attachments/assets/392c48f2-a94e-4ba2-ab8a-57ab892e3f11) The next step after finding the class name of the object (YTPlaybackButton) is to find a specific characteristic of this object that makes it unique. This is because when we are hooking this class, we only want to hide the button in this specific case, but not other cases. We can see other cases by using FLEX - Menu - Heap Objects - search for YTPlaybackButton. ![IMG_1690](https://github.com/user-attachments/assets/1ad54cd6-cb38-4d6d-a91c-e7e32e59c440) Let’s check what the other YTPlaybackButton object is for. ![IMG_1691](https://github.com/user-attachments/assets/d9d9dbc6-20fa-40c5-b8cd-ad5d069288e5) As you can see here, it is used for the minibar. We do not want to hide the minibar play button, so we need to find a unique characteristic of the player’s playback button object that we can use to filter it. Going back to our YTPlaybackButton object, a generally good technique for the first step in uniqueness is checking the accessibilityIdentifier property. This is something that all objects have, and if it is set by the YouTube developers properly, then it is a unique identifier for this specific object. ![IMG_1694](https://github.com/user-attachments/assets/dc7769a3-4602-4873-ac75-2787d96cc903) We can see here that it does indeed have an accessibilityIdentifier. Another property that all objects have is hidden. We can use this to hide an object easily. ![IMG_1686](https://github.com/user-attachments/assets/46bd2e8c-230c-4e40-8995-2d9993b0b709) Then we can write our hook like this: ```c %hook YTPlaybackButton - (void)layoutSubviews { %orig; if ([self.accessibilityIdentifier isEqualToString:@“id.player.play.button”]) { self.hidden = YES; } } %end ``` The layoutSubviews method is an easy method to hook because it is called any time that a view, like this button, changes state in any way. One of the things I struggled with early on was the syntax of objective-c. It isn’t like Python, Java, Javascript, C, C++ or any other language that I have seen before. ChatGPT was a big help in understanding how to write in the language early on. I will try translating it into Python and Java since these are languages that I think are closest to it ```python %hook YTPlaybackButton def layoutSubviews(): -> None %orig if self.accessibilityIdentifier == “id.player.play.button”: self.hidden = True ``` ```java %hook YTPlaybackButton void layoutSubviews() { %orig; if (self.accessibilityIdentifier.isEqual(“id.player.play.button”) { self.hidden = true; } } ``` —————————————————— Next, let’s say we wanted to remove the buttons under the player. We can use FLEX to figure out what class types they are. ![IMG_1696](https://github.com/user-attachments/assets/4935a4c6-8dea-48ee-b28f-db6d0e212170) Now we can check for a unique identifier like before ![IMG_1697](https://github.com/user-attachments/assets/e7f6e572-d992-46af-90f7-0d8b563b1a41) Let’s say we did the same thing as before and hid this element. The result would look like this ![IMG_1698](https://github.com/user-attachments/assets/6fa98e8c-7c46-4ba7-8c16-b5f7f14015d3) This is not a desirable effect. There is an empty space between the buttons. Therefore, we would need to do something more complicated to block the element from being added at all, rather than hiding the element after it has been added. I won’t get into the details now, but that is the general idea.
eliliam commented 2024-09-06 18:07:55 +00:00 (Migrated from github.com)

@bhackel wow, you're the man! Thanks for explaining in such depth, that's super helpful!

@bhackel wow, you're the man! Thanks for explaining in such depth, that's super helpful!
haomuch commented 2024-10-08 07:37:42 +00:00 (Migrated from github.com)

Yes, want this feature so much!

Yes, want this feature so much!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Creepso/YTLitePlus#404
No description provided.