fix(YouTube - Change live ring click action): Cannot play the playlist

This commit is contained in:
inotia00 2025-01-31 20:57:09 +09:00
parent 12f5ae5650
commit 3a27a56df9

View File

@ -1,5 +1,7 @@
package app.revanced.extension.youtube.patches.general;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import com.facebook.litho.ComponentHost;
@ -59,6 +61,14 @@ public final class OpenChannelOfLiveAvatarPatch {
if (componentHost.getChildCount() != 1) {
return;
}
// Play all button in playlist cannot be filtered with the above conditions
// Check the ViewGroup tree
if (!(componentHost.getChildAt(0) instanceof ComponentHost liveRingViewGroup)) {
return;
}
if (!(liveRingViewGroup.getChildAt(0) instanceof ImageView)) {
return;
}
// Fetch channel id
videoId = newlyLoadedVideoId;
VideoDetailsRequest.fetchRequestIfNeeded(newlyLoadedVideoId);