Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(YouTube - Playback speed): Add speed dialog button to video player #3197

Merged
merged 9 commits into from
Jun 2, 2024

Conversation

MarcaDian
Copy link
Contributor

@MarcaDian MarcaDian commented May 20, 2024

Adds a simply speed button to the bottom of video player that called flyout custom speed dialog same as from flyout menu.

Зображення WhatsApp, дата_ 2024-05-20 о 23 28 57_a81b6303

Partially closes #1620

integrations ReVanced/revanced-integrations#636

@MarcaDian
Copy link
Contributor Author

MarcaDian commented May 20, 2024

I'm also annoyed by the incorrect padding and the incorrect effect of clicking the bottom buttons. This should also be fixed sometime.
And maybe needed to group this buttons to own submenu in the settings.

@oSumAtrIX
Copy link
Member

Adding too many buttons will create overlaps for example with the chapters.

@cyberboh
Copy link

Adding too many buttons will create overlaps for example with the chapters.

Make some buttons toggleable and add warning before turned it ON. Seems it the best options.

@oSumAtrIX oSumAtrIX changed the title feat(YouTube): Adds custom speed dialog button in the video player feat(YouTube - Playback speed): Add speed dialog button in video player May 20, 2024
@oSumAtrIX oSumAtrIX changed the title feat(YouTube - Playback speed): Add speed dialog button in video player feat(YouTube - Playback speed): Add speed dialog button to video player May 20, 2024
@kazimmt
Copy link
Contributor

kazimmt commented May 21, 2024

This button will be helpful for non-root users as we encounter this issue: #3203

@MarcaDian
Copy link
Contributor Author

MarcaDian commented May 21, 2024

some trouble with push commit

@LisoUseInAIKyrios
Copy link
Contributor

This button will be helpful for non-root users as we encounter this issue: #3203

A button alone won't fix the missing flyout when spoofing (an empty speed menu is opened). However, the button could open a custom dialog that has the speeds, which then calls into a new patch hook to set the speed.

@MarcaDian
Copy link
Contributor Author

MarcaDian commented May 21, 2024

This button will be helpful for non-root users as we encounter this issue: #3203

A button alone won't fix the missing flyout when spoofing (an empty speed menu is opened). However, the button could open a custom dialog that has the speeds, which then calls into a new patch hook to set the speed.

I originally planned to make a speed dialog via AlertDialog, the dialog layout worked fine, but I don't know how to apply the selected speed in real time.
If you know, point me to this line of code

@LisoUseInAIKyrios
Copy link
Contributor

there already is some code to change the playback speed used by the default playback speed patch.

But that patch works by adding code to YT that calls into integrations to get the default speed, and this would require integrations calling into the YT code. Accomplishing that would probably be easiest if a static field was added to the same hooked YT class, the static field is set on object creation, and then add an additional method that sets the playback speed using that static object (that is the method that integrations would call). A lot of extra methods to add, and a lot more complications to add to the already slightly messy playback speed patch.

It almost seems simpler to find a way to force the built in speed menu to show the speed entries, so when this patch forces the speed menu to show then it all just works.

@MarcaDian
Copy link
Contributor Author

Anyway, I'm trying to set the selected speed using
RememberPlaybackSpeedPatch.userSelectedPlaybackSpeed(setSelectedSpeed); VideoInformation.overridePlaybackSpeed(setSelectedSpeed);
and it doesn't work 🤔

@LisoUseInAIKyrios
Copy link
Contributor

Neither of those will set the speed for this situation

@oSumAtrIX oSumAtrIX merged commit ad00305 into ReVanced:dev Jun 2, 2024
2 checks passed
revanced-bot pushed a commit that referenced this pull request Jun 2, 2024
# [4.9.0-dev.7](v4.9.0-dev.6...v4.9.0-dev.7) (2024-06-02)

### Features

* **YouTube - Playback speed:** Add option to show speed dialog button in video player ([#3197](#3197)) ([ad00305](ad00305))
revanced-bot pushed a commit that referenced this pull request Jun 2, 2024
# [4.9.0](v4.8.3...v4.9.0) (2024-06-02)

### Bug Fixes

* **YouTube - Spoof client:** Allow swipe gestures to enter/exit fullscreen when spoofing with `Android VR` client ([#3259](#3259)) ([5114900](5114900))
* **YouTube - Spoof client:** Restore playback speed menu when spoofing to an iOS client ([95f290f](95f290f))

### Features

* **Messenger:** Add `Hide inbox subtabs` patch ([#3163](#3163)) ([24e4ebd](24e4ebd))
* **YouTube - Hide layout components:** Disable like / subscribe button glow animation ([#3265](#3265)) ([68d35ea](68d35ea))
* **YouTube - Playback speed:** Add option to show speed dialog button in video player ([#3197](#3197)) ([ad00305](ad00305))
* **YouTube Music:** Support version `7.03` ([#3272](#3272)) ([d1ceca3](d1ceca3))
* **YouTube:** Support version `19.12`, `19.13`, `19.14`, `19.15` and `19.16` ([#3239](#3239)) ([99b07e0](99b07e0))
@MarcaDian MarcaDian deleted the speed_button branch June 2, 2024 21:26
E85Addict pushed a commit to E85Addict/revanced-patches that referenced this pull request Jun 2, 2024
# [4.9.0](v4.8.3...v4.9.0) (2024-06-02)

### Bug Fixes

* **YouTube - Spoof client:** Allow swipe gestures to enter/exit fullscreen when spoofing with `Android VR` client ([ReVanced#3259](https://github.com/E85Addict/revanced-patches/issues/3259)) ([5114900](5114900))
* **YouTube - Spoof client:** Restore playback speed menu when spoofing to an iOS client ([95f290f](95f290f))

### Features

* **Messenger:** Add `Hide inbox subtabs` patch ([ReVanced#3163](https://github.com/E85Addict/revanced-patches/issues/3163)) ([24e4ebd](24e4ebd))
* **YouTube - Hide layout components:** Disable like / subscribe button glow animation ([ReVanced#3265](https://github.com/E85Addict/revanced-patches/issues/3265)) ([68d35ea](68d35ea))
* **YouTube - Playback speed:** Add option to show speed dialog button in video player ([ReVanced#3197](https://github.com/E85Addict/revanced-patches/issues/3197)) ([ad00305](ad00305))
* **YouTube Music:** Support version `7.03` ([ReVanced#3272](https://github.com/E85Addict/revanced-patches/issues/3272)) ([d1ceca3](d1ceca3))
* **YouTube:** Support version `19.12`, `19.13`, `19.14`, `19.15` and `19.16` ([ReVanced#3239](https://github.com/E85Addict/revanced-patches/issues/3239)) ([99b07e0](99b07e0))

### Performance Improvements

* Personal Logo && Add upstream sync ([e9d6554](e9d6554))
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.

feat(YouTube): Playback Speed button, drag slider, double-tap zones
5 participants