Skip to content

Conversation

@pecazeco
Copy link
Contributor

What:

  • New option: Decrease/increase and set 1x speed buttons
  • When ON: Three new buttons shows up in the player screen: decrease speed by 0.25x, increase speed by 0.25x and reset it to 1x
  • When OFF: The player remains unchanged
The three buttons

Why:

How to test:

  1. When the option is disable, the player should remain as usual
  2. Go to Player > Increase/Decrease Speed buttons > turn on
  3. Now, the player should show the three new buttons
  4. Try to click on each buttons, check if the speed is changed and if the new speed is shown in the upper right corner, like the in image below
image

Notes:

  • The icons are a bit cut off depending on the window format, but I don't know very much about path elements to fix that
  • I think the icons could be a little more intuitive, with a + and - symbols, for example
  • Despite the playback speed itself being changed by the buttons, the playback speed display in the settings screen doesn't respond to this change
  • Although the playback speed can be changed using the buttons, the playback speed display on the settings screen doesn't match this change, I couldn't sync them

@halilnevzat
Copy link

thank you guys !!

child: svgIncrease,
onclick: function () {
const currentSpeed = ImprovedTube.playbackSpeed();
let newSpeed = Math.min(currentSpeed + 0.25, 2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add an option so the step can be configured?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this as requested.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that is a minor bug: the texts "increase speed by {step}" and "decrease speed by {step}" that shows up when hover the buttons only updates the value when you refresh the page.
image

@pecazeco pecazeco marked this pull request as draft October 29, 2025 15:22
@pecazeco pecazeco marked this pull request as ready for review October 29, 2025 15:29
Copy link
Contributor

@PerchunPak PerchunPak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are nitpicks, but I am not a fan of AI artifacts

@PerchunPak
Copy link
Contributor

Looks like speed-changing keybinds do a bit more logic than just changing the speed. Can we reuse that function?

ImprovedTube.shortcutIncreasePlaybackSpeed = function (decrease) {

@pecazeco
Copy link
Contributor Author

Looks like speed-changing keybinds do a bit more logic than just changing the speed. Can we reuse that function?

ImprovedTube.shortcutIncreasePlaybackSpeed = function (decrease) {

If we call it, it would be necessary to change a little bit this shortcutIncreasePlaybackSpeed. This method picks the step from shortcuts_playback_speed_step, which is a different variable from the one we use to set the step (player_custom_playback_speed_step).
We can create a new method copying this one (using the same logic) but using the different variable for the step. What do you think?

@PerchunPak
Copy link
Contributor

If we call it, it would be necessary to change a little bit this shortcutIncreasePlaybackSpeed. This method picks the step from shortcuts_playback_speed_step, which is a different variable from the one we use to set the step (player_custom_playback_speed_step).
We can create a new method copying this one (using the same logic) but using the different variable for the step. What do you think?

We should move this method somewhere in a shared place, rename it and just provide the step as a function argument

@ImprovedTube
Copy link
Member

thank you so much!! :) @pecazeco @PerchunPak

We should move this method somewhere in a shared place, rename it and just provide the step as a function argument

There is a lot of potential for this project to be more of a framework.
For example positioning should be separate from features too. Every feature function could have a shortcut and or icon at any position. Dynamic positions might need updates when youtube changes, but shortcut and fixed positions wont. We have buttons on the left of the player bar and on the right or below the player. And improvedtube_youtube_icon is in the header or sidebar or simply draggable anywhere (fixed position, mini player too)

@ImprovedTube ImprovedTube merged commit cb5b048 into code-charity:master Nov 24, 2025
1 check passed
@PerchunPak
Copy link
Contributor

For example positioning should be separate from features too. Every feature function could have a shortcut and or icon at any position. Dynamic positions might need updates when youtube changes, but shortcut and fixed positions wont. We have buttons on the left of the player bar and on the right or below the player. And improvedtube_youtube_icon is in the header or sidebar or simply draggable anywhere (fixed position, mini player too)

I don't really understand what you mean. I only talked about business logic, which is identical in both of those places.

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.

4 participants