youtube icon indicating copy to clipboard operation
youtube copied to clipboard

Changing playback speed with a hotkey does not work reliably

Open andraz opened this issue 1 year ago • 5 comments

BUG: Playback hotkeys only work sometimes. ⚬ Browser: Chrome ⚬ HOW:

  1. map playback speed to two keyboard buttons (in my case , and . on SI keyboard, they would be < and > in US)
  2. after refreshing the YouTube page, buttons work and increase/decrease playback speed
  3. but after some navigation or even just changing the system volume with a keyboard volume button, they stop working
  4. refreshing the page fixes the issue

Might be related to #2046 and #664 (my buttons are identical to the built in speed hotkeys without shift, but the YT built in buttons work only up to 2x so they are practically useless - alternative fix might be to remove this limitation, to allow built in hotkeys to work correctly up to 16x)

andraz avatar Apr 08 '24 00:04 andraz

thanks! @andraz is this true for our other shortcuts too?

everything about our shortcuts: #1565 (hopefully this motivates somebody to understand the whole script)

ImprovedTube avatar Apr 11 '24 08:04 ImprovedTube

No, it seems J and L continue to work fine, but speed hotkeys break after I change system volume with my media keys.

I did figure out I can fix this by CTRL+1..9 or CTRL+TAB to switch tabs away and back to the YouTube player.

After this workaround, hotkeys work again (until I break them again with volume change). This can be replicated multiple times.

andraz avatar Apr 11 '24 11:04 andraz

fascinating!

ImprovedTube avatar Apr 12 '24 04:04 ImprovedTube

no wait, since J & L are youtube defaults, my original question remain. also check the browser console, please. and logging out of youtube maybe

ImprovedTube avatar Apr 12 '24 04:04 ImprovedTube

Tested again with extra keys for skipping chapters back and forward linked to B and N.

They fail in the same way as speed buttons and can be fixed in same way, by switching tab focus away and back.

p.s.: checked console, no messages when broken or when fixed back to working state

andraz avatar Apr 12 '24 05:04 andraz

Tested again with extra keys for skipping chapters back and forward linked to B and N.

They fail in the same way as speed buttons and can be fixed in same way, by switching tab focus away and back.

looks like one of shortcuts bugs I just fixed, code wasnt keeping track of pressed keys well and losing events https://github.com/code-charity/youtube/pull/2421

raszpl avatar Jun 29 '24 05:06 raszpl