Skip to content

feat(YouTube - Hide player flyout menu components): Add "Hide Audio track footer", "Hide Audio track header", "Hide Captions footer", and "Hide Captions header" settings#642

Open
ILoveOpenSourceApplications wants to merge 20 commits intoMorpheApp:devfrom
ILoveOpenSourceApplications:fix/hide-quality-menu-components
Open

Conversation

@ILoveOpenSourceApplications
Copy link
Copy Markdown
Contributor

@ILoveOpenSourceApplications ILoveOpenSourceApplications commented Feb 25, 2026

Description

Adds options to hide Audio track menu and Captions menu header and footer.

04-07 03:59:01.050 25303 25303 D morphe: LithoFilterPatch: Searching ID: audio_track_sheet_footer.eml-fe|ad61931421b953a1 Path: audio_track_sheet_footer.eml-fe|ad61931421b953a1|ContainerType|ContainerType| BufferStrings: divider.eml-fe|e3618bde0d791def*❙theme|3fa5e5daabe2e85f❙333?❙dismiss❙$KEN_BURNS_ANIMATION_TYPE_UNSPECIFIED❙capabilities|b00d283d27cdca162❙theme|3fa5e5daabe2e85f❙capabilities|b00d283d27cdca16❙theme|3fa5e5daabe2e85f❙capabilities|b00d283d27cdca16❙
02-25 17:38:22.108  8696  8696 D morphe: LithoFilterPatch: Searching ID: bottom_sheet_header.eml-fe|9aa3bf964a31b51 Path: bottom_sheet_header.eml-fe|9aa3bf964a31b51|ContainerType| BufferStrings: *bottom_sheet_header.eml-fe|9aa3bf964a31b51*Captions❙theme|8702a255cc001eb0❙333?❙dismiss❙$KEN_BURNS_ANIMATION_TYPE_UNSPECIFIED❙capabilities|34e6cc3ea7faac412❙ bottom_sheet_scroll_position_key❙theme|8702a255cc001eb0❙capabilities|34e6cc3ea7faac41❙*bottom_sheet_header.eml-fe|9aa3bf964a31b512❙17720213204843089502-25 17:55:44.708  9424  9424 D morphe: LithoFilterPatch: Searching ID: quality_sheet_header.eml-js-fe|dc83d1e9bd79a7e4 Path: quality_sheet_header.eml-js-fe|dc83d1e9bd79a7e4|ContainerType|ContainerType|TextType| BufferStrings: /quality_sheet_header.eml-js-fe|dc83d1e9bd79a7e4*Quality for current video❙theme|8702a255cc001eb0❙333?❙dismiss❙$KEN_BURNS_ANIMATION_TYPE_UNSPECIFIED❙capabilities|34e6cc3ea7faac412❙0quality_sheet_header_controller|65b543c87f3feae2❙3createQualitySheetHeaderController|30432c33c7259fde(❙0quality_sheet_header_controller|65b543c87f3feae2❙4destroyQualitySheetHeaderController|30432c33c7259fde(❙0quality_sheet_header_controller|65b543c87f3feae2❙>notifyModelUpdateQualitySheetHeaderController|30432c33c7259fde(❙theme|8702a255cc001eb0❙capabilities|34e6cc3ea7faac41❙/quality_sheet_header.eml-js-fe|dc83d1e9bd79a7e42❙177202232763013894

Additional context

Just like #48, "Hide Quality header" only works on quick quality menu and not on advanced quality menu.

Test results

  • Tested on both the minimum and maximum supported versions
  • Tested on experimental supported versions (Optional)

…u header" and "Hide Quality menu header" settings
…u footer", "Hide Captions menu header", and "Hide Quality menu header" settings
@ILoveOpenSourceApplications ILoveOpenSourceApplications force-pushed the fix/hide-quality-menu-components branch from a267c29 to 2731eab Compare February 25, 2026 20:36
@ILoveOpenSourceApplications
Copy link
Copy Markdown
Contributor Author

All that time wasted and nothing happened. Damn.

Well, try to mark this draft and wait for @inotia00 to get some free time and take a look at this.

@ILoveOpenSourceApplications ILoveOpenSourceApplications marked this pull request as draft February 25, 2026 20:39
@ILoveOpenSourceApplications ILoveOpenSourceApplications changed the title feat(YouTube - Hide player flyout menu items): Add "Hide Captions menu header" and "Hide Quality menu header" settings feat(YouTube - Hide player flyout menu items): Add "Hide Captions menu footer", "Hide Captions menu header", and "Hide Quality menu header" settings Feb 25, 2026
@seasidesongs

This comment was marked as off-topic.

@ILoveOpenSourceApplications

This comment was marked as off-topic.

@ILoveOpenSourceApplications ILoveOpenSourceApplications force-pushed the fix/hide-quality-menu-components branch from 91000af to 64eb86a Compare March 16, 2026 09:50
# Conflicts:
#	extensions/youtube/src/main/java/app/morphe/extension/youtube/patches/components/PlayerFlyoutMenuComponentsFilter.java
@ILoveOpenSourceApplications
Copy link
Copy Markdown
Contributor Author

@0xrxL, do you have any methods to hide these headers and footers?

@0xrxL
Copy link
Copy Markdown
Contributor

0xrxL commented Apr 2, 2026

@0xrxL, do you have any methods to hide these headers and footers?

Post a screenshot of what you want to hide.

@ILoveOpenSourceApplications
Copy link
Copy Markdown
Contributor Author

Details

Screenshot_20260402_221636_YouTube
Screenshot_20260402_221629_YouTube

@0xrxL
Copy link
Copy Markdown
Contributor

0xrxL commented Apr 2, 2026

Yes, I already have a way to do that:

In the case of video quality, it uses the same trick of the resolutions flyout, to open it through the performClick(). You just need to hook to that class and find the right parent to hide. That's all.

@ILoveOpenSourceApplications
Copy link
Copy Markdown
Contributor Author

And how do I identify the right parent?

@0xrxL
Copy link
Copy Markdown
Contributor

0xrxL commented Apr 2, 2026

And how do I identify the right parent?

I'll give you a code to use. Wait a while. 👍

@0xrxL
Copy link
Copy Markdown
Contributor

0xrxL commented Apr 2, 2026

@ILoveOpenSourceApplications This is the logic for resolutions flyout. Readapt it for Morphe:

Schermata_20260402_212202
advancedQualitySheetContent = lithoFiltering.Contains("advanced_quality_sheet_content");



public static void HideLastChildInResolutionsFlyout(RecyclerView recyclerView) {
    if (recyclerView == null) {
        return;
    }

    recyclerView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            if (advancedQualitySheetContent) {
                recyclerView.getViewTreeObserver().removeOnGlobalLayoutListener(this);

                if (recyclerView != null && recyclerView.getChildCount() > 0) {
                    View advancedQualitySheetContent = recyclerView.getChildAt(0);

                    if (advancedQualitySheetContent instanceof ViewGroup aQSCViewGroup) {
                        int targetChild = aQSCViewGroup.getChildAt(aQSCViewGroup.getChildCount() - 1);
                    
                        if (targetChild != null) {
                            Utils.HideView(targetChild);
                        }
                    }
                }
            }
        }
    });
}

@0xrxL
Copy link
Copy Markdown
Contributor

0xrxL commented Apr 2, 2026

The exact same logic works for captions flyout too, just change this line:

lithoFiltering.Contains("advanced_quality_sheet_content");

to this:

lithoFiltering.Contains("captions_sheet_content");

@0xrxL
Copy link
Copy Markdown
Contributor

0xrxL commented Apr 2, 2026

P.S: The hook is obviously the same already used to automatically open the advanced resolutions flyout.

@ILoveOpenSourceApplications
Copy link
Copy Markdown
Contributor Author

I managed to hide the captions menu footer text, but the padding remained. Also, I couldn't get the quality menu header and footer to be hidden, what did I do wrong?

@0xrxL
Copy link
Copy Markdown
Contributor

0xrxL commented Apr 2, 2026

I managed to hide the captions menu footer text, but the padding remained. Also, I couldn't get the quality menu header and footer to be hidden, what did I do wrong?

The code that I provided only hide footer.

If you want to hide header, use the same code, but with a different child object.

P.S: About padding. I didn't found a solution.

@0xrxL
Copy link
Copy Markdown
Contributor

0xrxL commented Apr 2, 2026

For example instead to hide the last object based on length, hide the first.

@ILoveOpenSourceApplications
Copy link
Copy Markdown
Contributor Author

@0xrxL, I was able to hide the captions menu footer but if the header is also hidden, then the divider pops out. But no matter what I do, I can't get the quality menu header and footer to hide.

@LisoUseInAIKyrios, any idea what's going on?

footer.setVisibility(View.GONE);
}

View bottomDivider = viewGroup.getChildAt(childCount - 2);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these hard coded values wrong if other components are also being hidden?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Details

If both captions menu header and footer settings are on:
Screenshot 2026-04-03 150850

If only Hide captions footer is on:
Screenshot 2026-04-03 150927

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ILoveOpenSourceApplications When you hide an element, there is a possibility that the item you are going to hide contains more than one element. So you have to further unpack the child elements.

That's why hiding the header also gives you the first button hidden.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about Quality header and footer? Is the path not correct? is it not advanced_quality_sheet_content?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about Quality header and footer? Is the path not correct? is it not advanced_quality_sheet_content?

The path is right, but you're trying to hide the wrong element, because if you hide only the header but also the first button is also hidden, at this point there are other elements inside (and you just use getElementAt).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, captions menu now looks good. But quality menu, nope.

@ILoveOpenSourceApplications ILoveOpenSourceApplications changed the title feat(YouTube - Hide player flyout menu items): Add "Hide Captions menu footer", "Hide Captions menu header", and "Hide Quality menu header" settings feat(YouTube - Hide player flyout menu components): Add "Hide Captions footer", "Hide Captions header", and "Hide Quality header" settings Apr 3, 2026
@0xrxL
Copy link
Copy Markdown
Contributor

0xrxL commented Apr 3, 2026

It looks like you've managed to do it. As you can see, you don't have to panic. 😁

@ILoveOpenSourceApplications
Copy link
Copy Markdown
Contributor Author

Schermata_20260402_212202

Still can't get these to be hidden though.

@ILoveOpenSourceApplications ILoveOpenSourceApplications force-pushed the fix/hide-quality-menu-components branch from e889b7c to 4727107 Compare April 6, 2026 20:35
@ILoveOpenSourceApplications ILoveOpenSourceApplications changed the title feat(YouTube - Hide player flyout menu components): Add "Hide Captions footer", "Hide Captions header", and "Hide Quality header" settings feat(YouTube - Hide player flyout menu components): Add "Hide Audio track header", "Hide Captions footer", and "Hide Captions header" settings Apr 6, 2026
@ILoveOpenSourceApplications ILoveOpenSourceApplications marked this pull request as ready for review April 6, 2026 21:00
@ILoveOpenSourceApplications
Copy link
Copy Markdown
Contributor Author

I gave up on quality menu. I just can't seem to make it hide the header and footer. I just don't know why. Anyone else is welcomed to push a commit if they found a way, if not, this can be merged as is.

@ILoveOpenSourceApplications ILoveOpenSourceApplications changed the title feat(YouTube - Hide player flyout menu components): Add "Hide Audio track header", "Hide Captions footer", and "Hide Captions header" settings feat(YouTube - Hide player flyout menu components): Add "Hide Audio trackfooter", "Hide Audio track header", "Hide Captions footer", and "Hide Captions header" settings Apr 6, 2026
@ILoveOpenSourceApplications ILoveOpenSourceApplications force-pushed the fix/hide-quality-menu-components branch from b074352 to 2e56c52 Compare April 6, 2026 22:43
@ILoveOpenSourceApplications ILoveOpenSourceApplications changed the title feat(YouTube - Hide player flyout menu components): Add "Hide Audio trackfooter", "Hide Audio track header", "Hide Captions footer", and "Hide Captions header" settings feat(YouTube - Hide player flyout menu components): Add "Hide Audio track footer", "Hide Audio track header", "Hide Captions footer", and "Hide Captions header" settings Apr 6, 2026
@inotia00
Copy link
Copy Markdown
Contributor

inotia00 commented Apr 7, 2026

I was so busy that I couldn't even turn on my laptop for two weeks.

I will review the PR when I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants