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

Using keyboard shortcuts to pause/play makes pause/play not work #1993

Closed
AmarinReyny opened this issue Feb 6, 2024 · 6 comments
Closed
Assignees
Labels
Bug Bug or required update after YouTube changes good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥

Comments

@AmarinReyny
Copy link

Bug Report:

BUG: After installing and using the extension, using spacebar to switch between pause and play no longer works properly. If pressed while the video is playing, it will pause for only a brief moment, but will immediately resume playing; likewise, if pressed while the video is paused, it will play for only a brief moment, but will immediately go back to being paused. I tried setting the pause/play function to the spacebar in ImprovedTube's settings, but that did not solve the issue. The issue persisted until I uninstalled ImprovedTube.

HOW: 1. Install ImprovedTube.
2. Try to use the spacebar to pause/play a video.
3. Weep, for it does not work.

⚬ ImprovedTube Version: I've already uninstalled it. I can't check which version I had. I installed it yesterday, if that helps.

@AmarinReyny AmarinReyny added Bug Bug or required update after YouTube changes good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ labels Feb 6, 2024
@Jibby2k1
Copy link

Jibby2k1 commented Feb 7, 2024

Hey, I'm interested in taking on this issue, would that be possible?

@CRiS-SVRS
Copy link

CRiS-SVRS commented Feb 24, 2024

same issue here on two different machines.
setting the another key as keyboard shortcut for play/pause toggle ("P" in my case, for example) works as intended.

edit: just found out (for one machine only, the other one is at work and i can't try) that the issue maybe due to a powertoys component. closing powertoys from the tray restored the default spacebar shortcut.

@Anoaxx
Copy link

Anoaxx commented Feb 24, 2024

Shortcuts are buggy. Sometimes its easier to backup settings and just... reinstal extension.

same issue here on two different machines. setting the another key as keyboard shortcut for play/pause toggle ("P" in my case, for example) works as intended.

edit: just found out (for one machine only, the other one is at work and i can't try) that the issue maybe due to a powertoys component. closing powertoys from the tray restored the default spacebar shortcut.

@ImprovedTube
Copy link
Member

#1565

yay @Jibby2k1

@raszpl
Copy link
Contributor

raszpl commented Mar 4, 2024

Cant reproduce. Youtube does Pause/Play with spacebar without any extensions. if you configure ImproveTube to pause on space too it will double the action resulting in exactly what is described here.

What ImproveTube could do is cancel all other events after intercepting Space, or just not letting Space be used.
#1815
there is tons of issues about this :/ remove space as default shortcut to fix this

@raszpl
Copy link
Contributor

raszpl commented Jun 29, 2024

EDIT after 3 months and actually reading shortcuts code: My previous comment was fully wrong. This shouldnt happen. Configuring anything in ImproveTube on Spacebar should override YT default action.

Can reproduce, this simple code just simply doesnt work:

ImprovedTube.shortcutPlayPause = function () {
if (this.elements.player) {
if (this.elements.video.paused) {
this.elements.player.playVideo();
} else {
this.elements.player.pauseVideo();
}
}
};

Cause: YT doesnt use Click event for Space and Space alone !?!?! it uses KeyUp event. We only cancel keydown events.
Two options:

  • make Space a special case and specifically check for it on every key press to be ready to cancel if custom Space shortcut is installed
  • prevent users from configuring Space in the first place

EDIT: or actually cancel all keyup events corresponding to triggered keydown shortcuts, FIXED
Now why was YT Space shortcut a special case listening to keyup events? Because of magical YT 'Hold Spacebar for 2x>>' fast forward function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug or required update after YouTube changes good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥
Projects
None yet
Development

No branches or pull requests

6 participants