feat(YouTube): Add experimental support for 21.20.493
Co-Authored-By: LisoUseInAIKyrios <118716522+lisouseinaikyrios@users.noreply.github.com>
This commit is contained in:
parent
20079d267a
commit
7f52ec2cea
4 changed files with 37 additions and 8 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package app.revanced.extension.youtube.patches;
|
||||
|
||||
import static app.revanced.extension.youtube.patches.VersionCheckPatch.IS_21_10_OR_GREATER;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
|
@ -24,7 +26,12 @@ public class ShortsAutoplayPatch {
|
|||
/**
|
||||
* Pause playback after 1 play.
|
||||
*/
|
||||
END_SCREEN;
|
||||
END_SCREEN,
|
||||
/**
|
||||
* Play once, then advanced to the next Short.
|
||||
* Only found in 21.10+
|
||||
*/
|
||||
AUTO_ADVANCE;
|
||||
|
||||
static void setYTEnumValue(Enum<?> ytBehavior) {
|
||||
for (ShortsLoopBehavior rvBehavior : values()) {
|
||||
|
|
@ -93,8 +100,12 @@ public class ShortsAutoplayPatch {
|
|||
autoplay = Settings.SHORTS_AUTOPLAY.get();
|
||||
}
|
||||
|
||||
Enum<?> overrideBehavior = (autoplay
|
||||
ShortsLoopBehavior autoPlayBehavior = IS_21_10_OR_GREATER
|
||||
? ShortsLoopBehavior.SINGLE_PLAY
|
||||
: ShortsLoopBehavior.AUTO_ADVANCE;
|
||||
|
||||
Enum<?> overrideBehavior = (autoplay
|
||||
? autoPlayBehavior
|
||||
: ShortsLoopBehavior.REPEAT).ytEnumValue;
|
||||
|
||||
if (overrideBehavior != null) {
|
||||
|
|
|
|||
|
|
@ -27,4 +27,6 @@ public class VersionCheckPatch {
|
|||
public static final boolean IS_20_31_OR_GREATER = isVersionOrGreater("20.31.00");
|
||||
|
||||
public static final boolean IS_20_37_OR_GREATER = isVersionOrGreater("20.37.00");
|
||||
|
||||
public static final boolean IS_21_10_OR_GREATER = isVersionOrGreater("21.10.00");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue