From 777ffb13605dcedd58f22ccbedf62a12201e85cf Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 1 Jun 2024 00:57:47 +0400 Subject: [PATCH 01/10] feat(YouTube - Hide layout components): Disable like / subscribe button glow animation (#646) --- .../components/LayoutComponentsFilter.java | 20 +++++++++++++++++++ .../youtube/settings/Settings.java | 1 + 2 files changed, 21 insertions(+) diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java b/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java index 90ed3841..0e799504 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java @@ -17,6 +17,10 @@ import app.revanced.integrations.youtube.shared.PlayerType; @SuppressWarnings("unused") public final class LayoutComponentsFilter extends Filter { + private static final String COMPACT_CHANNEL_BAR_PATH_PREFIX = "compact_channel_bar.eml"; + private static final String VIDEO_ACTION_BAR_PATH_PREFIX = "video_action_bar.eml"; + private static final String ANIMATED_VECTOR_TYPE_PATH = "AnimatedVectorType"; + private final StringTrieSearch exceptions = new StringTrieSearch(); private static final StringTrieSearch mixPlaylistsExceptions = new StringTrieSearch(); private static final ByteArrayFilterGroup mixPlaylistsExceptions2 = new ByteArrayFilterGroup( @@ -37,6 +41,7 @@ public final class LayoutComponentsFilter extends Filter { private final StringFilterGroup compactChannelBarInner; private final StringFilterGroup compactChannelBarInnerButton; private final ByteArrayFilterGroup joinMembershipButton; + private final StringFilterGroup likeSubscribeGlow; private final StringFilterGroup horizontalShelves; static { @@ -224,6 +229,11 @@ public final class LayoutComponentsFilter extends Filter { "sponsorships" ); + likeSubscribeGlow = new StringFilterGroup( + Settings.DISABLE_LIKE_SUBSCRIBE_GLOW, + "animated_button_border.eml" + ); + final var channelWatermark = new StringFilterGroup( Settings.HIDE_VIDEO_CHANNEL_WATERMARK, "featured_channel_watermark_overlay" @@ -255,6 +265,7 @@ public final class LayoutComponentsFilter extends Filter { expandableMetadata, inFeedSurvey, notifyMe, + likeSubscribeGlow, channelBar, communityPosts, paidPromotion, @@ -293,6 +304,15 @@ public final class LayoutComponentsFilter extends Filter { return false; } + if (matchedGroup == likeSubscribeGlow) { + if ((path.startsWith(VIDEO_ACTION_BAR_PATH_PREFIX) || path.startsWith(COMPACT_CHANNEL_BAR_PATH_PREFIX)) + && path.contains(ANIMATED_VECTOR_TYPE_PATH)) { + return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex); + } + + return false; + } + // The groups are excluded from the filter due to the exceptions list below. // Filter them separately here. if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey || matchedGroup == expandableMetadata) diff --git a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java index f82450c5..359aa774 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java +++ b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java @@ -121,6 +121,7 @@ public class Settings extends BaseSettings { // Player public static final BooleanSetting DISABLE_FULLSCREEN_AMBIENT_MODE = new BooleanSetting("revanced_disable_fullscreen_ambient_mode", TRUE, true); public static final BooleanSetting DISABLE_ROLLING_NUMBER_ANIMATIONS = new BooleanSetting("revanced_disable_rolling_number_animations", FALSE); + public static final BooleanSetting DISABLE_LIKE_SUBSCRIBE_GLOW = new BooleanSetting("revanced_disable_like_subscribe_glow", FALSE); public static final BooleanSetting HIDE_AUTOPLAY_BUTTON = new BooleanSetting("revanced_hide_autoplay_button", TRUE, true); public static final BooleanSetting HIDE_CAST_BUTTON = new BooleanSetting("revanced_hide_cast_button", TRUE, true); public static final BooleanSetting HIDE_PLAYER_BUTTONS = new BooleanSetting("revanced_hide_player_buttons", FALSE); From b1109350fa670dc958c6493b39e31d9700b09d9c Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 31 May 2024 21:01:12 +0000 Subject: [PATCH 02/10] chore(release): 1.10.0-dev.1 [skip ci] # [1.10.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.9.2...v1.10.0-dev.1) (2024-05-31) ### Features * **YouTube - Hide layout components:** Disable like / subscribe button glow animation ([#646](https://github.com/ReVanced/revanced-integrations/issues/646)) ([777ffb1](https://github.com/ReVanced/revanced-integrations/commit/777ffb13605dcedd58f22ccbedf62a12201e85cf)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a28e7b0..0533a7af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.10.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.9.2...v1.10.0-dev.1) (2024-05-31) + + +### Features + +* **YouTube - Hide layout components:** Disable like / subscribe button glow animation ([#646](https://github.com/ReVanced/revanced-integrations/issues/646)) ([777ffb1](https://github.com/ReVanced/revanced-integrations/commit/777ffb13605dcedd58f22ccbedf62a12201e85cf)) + ## [1.9.2](https://github.com/ReVanced/revanced-integrations/compare/v1.9.1...v1.9.2) (2024-05-31) diff --git a/gradle.properties b/gradle.properties index 78b95a4e..72946825 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.9.2 +version = 1.10.0-dev.1 From b826865ef40a55dc79e6e146e3c35bfe7d792886 Mon Sep 17 00:00:00 2001 From: KAZI MMT <82371061+kazimmt@users.noreply.github.com> Date: Sat, 1 Jun 2024 15:29:14 +0600 Subject: [PATCH 03/10] fix(YouTube - Spoof client): Allow swipe gestures to enter/exit fullscreen when spoofing with `Android VR` client (#645) --- .../youtube/patches/spoof/SpoofClientPatch.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/spoof/SpoofClientPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/spoof/SpoofClientPatch.java index 6ce8da4f..6c265e6b 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/spoof/SpoofClientPatch.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/spoof/SpoofClientPatch.java @@ -101,6 +101,13 @@ public class SpoofClientPatch { return originalClientModel; } + /** + * Injection point. + */ + public static boolean enablePlayerGesture(boolean original) { + return SPOOF_CLIENT_ENABLED || original; + } + /** * Injection point. */ From a7e93904791c6fd313e34316d22e512460cd9fb4 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 1 Jun 2024 09:32:09 +0000 Subject: [PATCH 04/10] chore(release): 1.10.0-dev.2 [skip ci] # [1.10.0-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.1...v1.10.0-dev.2) (2024-06-01) ### Bug Fixes * **YouTube - Spoof client:** Allow swipe gestures to enter/exit fullscreen when spoofing with `Android VR` client ([#645](https://github.com/ReVanced/revanced-integrations/issues/645)) ([b826865](https://github.com/ReVanced/revanced-integrations/commit/b826865ef40a55dc79e6e146e3c35bfe7d792886)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0533a7af..25ec373c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.10.0-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.1...v1.10.0-dev.2) (2024-06-01) + + +### Bug Fixes + +* **YouTube - Spoof client:** Allow swipe gestures to enter/exit fullscreen when spoofing with `Android VR` client ([#645](https://github.com/ReVanced/revanced-integrations/issues/645)) ([b826865](https://github.com/ReVanced/revanced-integrations/commit/b826865ef40a55dc79e6e146e3c35bfe7d792886)) + # [1.10.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.9.2...v1.10.0-dev.1) (2024-05-31) diff --git a/gradle.properties b/gradle.properties index 72946825..af5a5368 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.10.0-dev.1 +version = 1.10.0-dev.2 From 4dce73a6fbfeeffb8c2b1759b9c5a5eacb1e3d4b Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 1 Jun 2024 22:02:48 +0400 Subject: [PATCH 05/10] feat(YouTube): Support version `19.12`, `19.13`, `19.14`, `19.15` and `19.16` (#643) --- .../patches/HideAutoplayButtonPatch.java | 10 +++- .../components/LayoutComponentsFilter.java | 55 ++++++++++--------- .../RestoreOldVideoQualityMenuPatch.java | 4 +- 3 files changed, 39 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/HideAutoplayButtonPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/HideAutoplayButtonPatch.java index 79a40d64..846905c2 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/HideAutoplayButtonPatch.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/HideAutoplayButtonPatch.java @@ -4,7 +4,13 @@ import app.revanced.integrations.youtube.settings.Settings; @SuppressWarnings("unused") public class HideAutoplayButtonPatch { - public static boolean isButtonShown() { - return !Settings.HIDE_AUTOPLAY_BUTTON.get(); + + private static final Boolean HIDE_AUTOPLAY_BUTTON_ENABLED = Settings.HIDE_AUTOPLAY_BUTTON.get(); + + /** + * Injection point. + */ + public static boolean hideAutoPlayButton() { + return HIDE_AUTOPLAY_BUTTON_ENABLED; } } diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java b/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java index 0e799504..522658c5 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java @@ -21,17 +21,20 @@ public final class LayoutComponentsFilter extends Filter { private static final String VIDEO_ACTION_BAR_PATH_PREFIX = "video_action_bar.eml"; private static final String ANIMATED_VECTOR_TYPE_PATH = "AnimatedVectorType"; - private final StringTrieSearch exceptions = new StringTrieSearch(); - private static final StringTrieSearch mixPlaylistsExceptions = new StringTrieSearch(); + private static final StringTrieSearch mixPlaylistsExceptions = new StringTrieSearch( + "V.ED", // Playlist browse id. + "java.lang.ref.WeakReference" + ); private static final ByteArrayFilterGroup mixPlaylistsExceptions2 = new ByteArrayFilterGroup( null, "cell_description_body" ); - private static final ByteArrayFilterGroup mixPlaylists = new ByteArrayFilterGroup( Settings.HIDE_MIX_PLAYLISTS, "&list=" ); + + private final StringTrieSearch exceptions = new StringTrieSearch(); private final StringFilterGroup searchResultShelfHeader; private final StringFilterGroup inFeedSurvey; private final StringFilterGroup notifyMe; @@ -44,13 +47,6 @@ public final class LayoutComponentsFilter extends Filter { private final StringFilterGroup likeSubscribeGlow; private final StringFilterGroup horizontalShelves; - static { - mixPlaylistsExceptions.addPatterns( - "V.ED", // Playlist browse id. - "java.lang.ref.WeakReference" - ); - } - @RequiresApi(api = Build.VERSION_CODES.N) public LayoutComponentsFilter() { exceptions.addPatterns( @@ -353,24 +349,31 @@ public final class LayoutComponentsFilter extends Filter { * Called from a different place then the other filters. */ public static boolean filterMixPlaylists(final Object conversionContext, @Nullable final byte[] bytes) { - if (bytes == null) { - Logger.printDebug(() -> "bytes is null"); - return false; + try { + if (bytes == null) { + Logger.printDebug(() -> "bytes is null"); + return false; + } + + // Prevent playlist items being hidden, if a mix playlist is present in it. + if (mixPlaylistsExceptions.matches(conversionContext.toString())) { + return false; + } + + // Prevent hiding the description of some videos accidentally. + if (mixPlaylistsExceptions2.check(bytes).isFiltered()) { + return false; + } + + if (mixPlaylists.check(bytes).isFiltered()) { + Logger.printDebug(() -> "Filtered mix playlist"); + return true; + } + } catch (Exception ex) { + Logger.printException(() -> "filterMixPlaylists failure", ex); } - // Prevent playlist items being hidden, if a mix playlist is present in it. - if (mixPlaylistsExceptions.matches(conversionContext.toString())) - return false; - - if (!mixPlaylists.check(bytes).isFiltered()) - return false; - - // Prevent hiding the description of some videos accidentally. - if (mixPlaylistsExceptions2.check(bytes).isFiltered()) - return false; - - Logger.printDebug(() -> "Filtered mix playlist"); - return true; + return false; } /** diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/playback/quality/RestoreOldVideoQualityMenuPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/playback/quality/RestoreOldVideoQualityMenuPatch.java index 1cc65371..42faeecf 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/playback/quality/RestoreOldVideoQualityMenuPatch.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/playback/quality/RestoreOldVideoQualityMenuPatch.java @@ -70,8 +70,8 @@ public final class RestoreOldVideoQualityMenuPatch { * * Used to force the creation of the advanced menu item for the Shorts quality flyout. */ - public static boolean forceAdvancedVideoQualityMenuCreation() { - return Settings.RESTORE_OLD_VIDEO_QUALITY_MENU.get(); + public static boolean forceAdvancedVideoQualityMenuCreation(boolean original) { + return Settings.RESTORE_OLD_VIDEO_QUALITY_MENU.get() || original; } /** From caa94fa6a4fd41e7641085ea4a486a81c058993b Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 1 Jun 2024 18:12:48 +0000 Subject: [PATCH 06/10] chore(release): 1.10.0-dev.3 [skip ci] # [1.10.0-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.2...v1.10.0-dev.3) (2024-06-01) ### Features * **YouTube:** Support version `19.12`, `19.13`, `19.14`, `19.15` and `19.16` ([#643](https://github.com/ReVanced/revanced-integrations/issues/643)) ([4dce73a](https://github.com/ReVanced/revanced-integrations/commit/4dce73a6fbfeeffb8c2b1759b9c5a5eacb1e3d4b)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25ec373c..eaf315f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.10.0-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.2...v1.10.0-dev.3) (2024-06-01) + + +### Features + +* **YouTube:** Support version `19.12`, `19.13`, `19.14`, `19.15` and `19.16` ([#643](https://github.com/ReVanced/revanced-integrations/issues/643)) ([4dce73a](https://github.com/ReVanced/revanced-integrations/commit/4dce73a6fbfeeffb8c2b1759b9c5a5eacb1e3d4b)) + # [1.10.0-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.1...v1.10.0-dev.2) (2024-06-01) diff --git a/gradle.properties b/gradle.properties index af5a5368..af499aa9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.10.0-dev.2 +version = 1.10.0-dev.3 From 2b2a70e6ea02ab3d140d500860d1c70c359fe8ef Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 2 Jun 2024 17:43:40 +0200 Subject: [PATCH 07/10] fix(YouTube - Spoof client): Restore playback speed menu when spoofing to an iOS client --- .../youtube/patches/spoof/SpoofClientPatch.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/spoof/SpoofClientPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/spoof/SpoofClientPatch.java index 6c265e6b..9dc021f5 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/spoof/SpoofClientPatch.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/spoof/SpoofClientPatch.java @@ -4,7 +4,6 @@ import android.media.MediaCodecInfo; import android.media.MediaCodecList; import android.net.Uri; import android.os.Build; - import app.revanced.integrations.shared.Logger; import app.revanced.integrations.youtube.settings.Settings; @@ -115,6 +114,19 @@ public class SpoofClientPatch { return SPOOF_CLIENT_ENABLED; } + /** + * Injection point. + * When spoofing the client to iOS, the playback speed menu is missing from the player response. + * Return true to force create the playback speed menu. + */ + public static boolean forceCreatePlaybackSpeedMenu(boolean original) { + if (SPOOF_CLIENT_ENABLED && SPOOF_CLIENT_TYPE == ClientType.IOS) { + return true; + } + + return original; + } + private enum ClientType { // https://dumps.tadiphone.dev/dumps/oculus/monterey/-/blob/vr_monterey-user-7.1.1-NGI77B-256550.6810.0-release-keys/system/system/build.prop // version 1.37 is not the latest, but it works with livestream audio only playback. From 571ce75c846f6387e878804cc46a26e9abecc802 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 2 Jun 2024 15:46:59 +0000 Subject: [PATCH 08/10] chore(release): 1.10.0-dev.4 [skip ci] # [1.10.0-dev.4](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.3...v1.10.0-dev.4) (2024-06-02) ### Bug Fixes * **YouTube - Spoof client:** Restore playback speed menu when spoofing to an iOS client ([2b2a70e](https://github.com/ReVanced/revanced-integrations/commit/2b2a70e6ea02ab3d140d500860d1c70c359fe8ef)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaf315f2..3dc912a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.10.0-dev.4](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.3...v1.10.0-dev.4) (2024-06-02) + + +### Bug Fixes + +* **YouTube - Spoof client:** Restore playback speed menu when spoofing to an iOS client ([2b2a70e](https://github.com/ReVanced/revanced-integrations/commit/2b2a70e6ea02ab3d140d500860d1c70c359fe8ef)) + # [1.10.0-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.2...v1.10.0-dev.3) (2024-06-01) diff --git a/gradle.properties b/gradle.properties index af499aa9..bd3706bd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.10.0-dev.3 +version = 1.10.0-dev.4 From 59220d6e25380d5fe6cc8c75456c04d980a83f34 Mon Sep 17 00:00:00 2001 From: MarcaD <152095496+MarcaDian@users.noreply.github.com> Date: Sun, 2 Jun 2024 18:48:02 +0300 Subject: [PATCH 09/10] feat(YouTube - Playback speed): Add option to show speed dialog button in video player (#636) Co-authored-by: oSumAtrIX --- .../speed/CustomPlaybackSpeedPatch.java | 2 +- .../youtube/settings/Settings.java | 1 + .../PlaybackSpeedDialogButton.java | 43 +++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/app/revanced/integrations/youtube/videoplayer/PlaybackSpeedDialogButton.java diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/playback/speed/CustomPlaybackSpeedPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/playback/speed/CustomPlaybackSpeedPatch.java index 59d63bcb..2ca56ed3 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/playback/speed/CustomPlaybackSpeedPatch.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/playback/speed/CustomPlaybackSpeedPatch.java @@ -159,7 +159,7 @@ public class CustomPlaybackSpeedPatch { }); } - private static void showOldPlaybackSpeedMenu() { + public static void showOldPlaybackSpeedMenu() { // This method is sometimes used multiple times. // To prevent this, ignore method reuse within 1 second. final long now = System.currentTimeMillis(); diff --git a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java index 359aa774..dd5eec20 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java +++ b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java @@ -127,6 +127,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting HIDE_PLAYER_BUTTONS = new BooleanSetting("revanced_hide_player_buttons", FALSE); public static final BooleanSetting COPY_VIDEO_URL = new BooleanSetting("revanced_copy_video_url", FALSE); public static final BooleanSetting COPY_VIDEO_URL_TIMESTAMP = new BooleanSetting("revanced_copy_video_url_timestamp", TRUE); + public static final BooleanSetting PLAYBACK_SPEED_DIALOG_BUTTON = new BooleanSetting("revanced_playback_speed_dialog_button", FALSE); // External downloader public static final BooleanSetting EXTERNAL_DOWNLOADER = new BooleanSetting("revanced_external_downloader", FALSE); diff --git a/app/src/main/java/app/revanced/integrations/youtube/videoplayer/PlaybackSpeedDialogButton.java b/app/src/main/java/app/revanced/integrations/youtube/videoplayer/PlaybackSpeedDialogButton.java new file mode 100644 index 00000000..0acf184a --- /dev/null +++ b/app/src/main/java/app/revanced/integrations/youtube/videoplayer/PlaybackSpeedDialogButton.java @@ -0,0 +1,43 @@ +package app.revanced.integrations.youtube.videoplayer; + +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.Nullable; + +import app.revanced.integrations.youtube.patches.playback.speed.CustomPlaybackSpeedPatch; +import app.revanced.integrations.youtube.settings.Settings; +import app.revanced.integrations.shared.Logger; + +public class PlaybackSpeedDialogButton extends BottomControlButton { + @Nullable + private static PlaybackSpeedDialogButton instance; + + public PlaybackSpeedDialogButton(ViewGroup viewGroup) { + super( + viewGroup, + "revanced_playback_speed_dialog_button", + Settings.PLAYBACK_SPEED_DIALOG_BUTTON, + view -> CustomPlaybackSpeedPatch.showOldPlaybackSpeedMenu(), + null + ); + } + + /** + * Injection point. + */ + public static void initializeButton(View view) { + try { + instance = new PlaybackSpeedDialogButton((ViewGroup) view); + } catch (Exception ex) { + Logger.printException(() -> "initializeButton failure", ex); + } + } + + /** + * Injection point. + */ + public static void changeVisibility(boolean showing) { + if (instance != null) instance.setVisibility(showing); + } +} \ No newline at end of file From 240e19966d04b46b36453e6c84e4a2d2dbda6563 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 2 Jun 2024 15:51:00 +0000 Subject: [PATCH 10/10] chore(release): 1.10.0-dev.5 [skip ci] # [1.10.0-dev.5](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.4...v1.10.0-dev.5) (2024-06-02) ### Features * **YouTube - Playback speed:** Add option to show speed dialog button in video player ([#636](https://github.com/ReVanced/revanced-integrations/issues/636)) ([59220d6](https://github.com/ReVanced/revanced-integrations/commit/59220d6e25380d5fe6cc8c75456c04d980a83f34)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dc912a3..c38a8700 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.10.0-dev.5](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.4...v1.10.0-dev.5) (2024-06-02) + + +### Features + +* **YouTube - Playback speed:** Add option to show speed dialog button in video player ([#636](https://github.com/ReVanced/revanced-integrations/issues/636)) ([59220d6](https://github.com/ReVanced/revanced-integrations/commit/59220d6e25380d5fe6cc8c75456c04d980a83f34)) + # [1.10.0-dev.4](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.3...v1.10.0-dev.4) (2024-06-02) diff --git a/gradle.properties b/gradle.properties index bd3706bd..16415b07 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.10.0-dev.4 +version = 1.10.0-dev.5