fix(YouTube - Hide Shorts components): Hide Shorts shelf hides autoplaying videos in the feed

Co-Authored-By: inotia00 <108592928+inotia00@users.noreply.github.com>
This commit is contained in:
oSumAtrIX 2026-03-11 11:24:05 +01:00
parent 23676746a6
commit 15096257ca
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4

View file

@ -26,10 +26,6 @@ import app.revanced.extension.youtube.shared.PlayerType;
public final class ShortsFilter extends Filter {
private static final boolean HIDE_SHORTS_NAVIGATION_BAR = Settings.HIDE_SHORTS_NAVIGATION_BAR.get();
private static final String COMPONENT_TYPE = "ComponentType";
private static final String[] REEL_ACTION_BAR_PATHS = {
"reel_action_bar.", // Regular Shorts.
"reels_player_overlay_layout." // Shorts ads.
};
private final String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.e";
/**
@ -498,6 +494,15 @@ public final class ShortsFilter extends Filter {
if (!hideHome && !hideSubscriptions && !hideSearch && !hideVideoDescription && !hideHistory) {
return false;
}
// The Litho path of the feed video is 'video_lockup_with_attachment.e'.
// It appears shortsCompactFeedVideoBuffer is used after 20 seconds during autoplay in the feed in YouTube 20.44.38.
// If the Shorts shelf is hidden on the Home feed, the video in the feed will be hidden after 20 seconds have passed since autoplay began in the feed.
//
// When a video is autoplaying in the feed, no new components are drawn on the screen.
// Therefore, filtering is skipped when the current PlayerType is INLINE_MINIMAL.
if (PlayerType.getCurrent() == PlayerType.INLINE_MINIMAL) {
return false;
}
if (hideHome && hideSubscriptions && hideSearch && hideVideoDescription && hideHistory) {
return true;
}