TeamPiped / Piped

An alternative privacy-friendly YouTube frontend which is efficient by design.
https://piped.video
GNU Affero General Public License v3.0
8.17k stars 665 forks source link

Don't let player capture Home and End keys #3706

Open opusforlife2 opened 1 month ago

opusforlife2 commented 1 month ago

Official Instance

Describe the bug

Along with Pg Up and Pg Dn, the Home and End keys can be used to jump scroll pages. However, on Piped, the latter 2 keys are captured by the player, and instead of jumping to the page top and bottom, they jump to the video beginning and end.

To Reproduce

  1. Play any video.
  2. Use the Pg Up and Pg Dn keys. These work fine.
  3. Use the Home and End keys. These restart/end the video instead of scrolling the page.

Expected behavior

The player should not capture the Home and End keys.

Logs/Errors

No response

Browser, and OS with Version.

Firefox 128, W10.

Additional context

No response

Bnyro commented 1 month ago

Imo it's reasonable enough to capture home and end keys, that's been added with https://github.com/TeamPiped/Piped/pull/3664 and should be the expected behavior.

opusforlife2 commented 1 month ago

That PR has no description or sample video so I can't tell how it uses these keys.

Anyway, I think the main idea here is that when the focus is with the player, it's expected that certain keys will have overrides to act as shortcuts for various player functions.

However, when the player loses focus, the keys should go back to performing functions expected of them for the rest of the webpage.

AndyRusso commented 1 month ago

I agree with OP. I have lost my position in videos when pressing home key while being deep into reading comments to go back up - it's not intuitive to capture home and end keys at all times in my opinion.

ac615223s5 commented 2 weeks ago

I added it because it is the behaviour on youtube but I don't mind either way. Also, it's related to #3136.

opusforlife2 commented 2 weeks ago

I vaguely remember back when I used Youtube that it had pretty wacky behaviour. This might have been one of those things.