jellyfin-web
jellyfin-web copied to clipboard
play/pause when Enter is pressed on non-dragging position slider
(new PR created because #5685 was wrong branch)
Hey there, first time contributor here! Open to any and all feedback.
Changes
Background: This fixes a minor annoyance while using Jellyfin on my LG TV that does not have a play/pause media button on the remote (only an "OK" button between the navigation arrows):
Current behavior
Pressing "Enter" on the now playing position slider when it is not being dragged does nothing. This means resuming playback after scrubbing the position slider requires 4 inputs every time to manually click the OSD Play button: Down -> Right -> Right -> OK
New behavior
Pressing "Enter" on the position slider when it is not being dragged will play/pause the current media. Now resuming playback after scrubbing only requires one remote input: OK
To achieve this, I play/pause the video in a new "keydown" listener attached to the position slider in the video controller. It does not play/pause if default was prevented (which happens when the slider is dragged (left/right arrows) and Enter is pressed).
Manual testing
I tested these changes manually using LG's simulator.