youtube
youtube copied to clipboard
Using keyboard shortcuts to pause/play makes pause/play not work
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.
Hey, I'm interested in taking on this issue, would that be possible?
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.
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.
#1565
yay @Jibby2k1
~~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. https://github.com/code-charity/youtube/issues/1815 there is tons of issues about this :/ remove space as default shortcut to fix this~~
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: https://github.com/code-charity/youtube/blob/e1c339d6b994d8824779f9cd55ca096d42838ec9/js%26css/web-accessible/www.youtube.com/shortcuts.js#L278-L286
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.