play/pause when Enter is pressed on non-dragging position slider #5685
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 needed to dispatch a new event "playpause" from the emby-slider component, and listen for that event in the playback/video controller.
Manual testing
I tested these changes manually using LG's simulator.