Skip to content

Add keyboard shortcuts for general functions and video player #1503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

owi92
Copy link
Member

@owi92 owi92 commented Jul 29, 2025

This adds the following shortcuts:
Bildschirmfoto 2025-07-29 um 14 49 10

Note that right now, the play shortcut cannot be used to start a video yet, only to pause and resume play. I do realize that this is suboptimal and am looking for a solution.

Also, the "general" section is pretty bare bones, but I could imagine adding some more shortcuts, for example for changing the language or color scheme. On the other hand I would not add shortcuts for every single conceivable action.

Review commit by commit.

Resolves #1416

@owi92 owi92 added area:frontend Everything frontend related kind:improvement needs:research Needs research as we are lacking knowledge to make an informed decision changelog:user User facing changes javascript Pull requests that update Javascript code area:accessibility Accessibility related issues area:usability Usability related issues area:player Paella and its integration in Tobira labels Jul 29, 2025
@github-actions github-actions bot temporarily deployed to test-deployment-pr1503 July 29, 2025 15:17 Destroyed
This is mostly copied over from Opencast Studio
as we aim for a coherent design and user experience.
Player shortcuts will be added in the next commit.
@github-actions github-actions bot temporarily deployed to test-deployment-pr1503 July 30, 2025 09:02 Destroyed
owi92 added 5 commits July 31, 2025 16:49
These are mostly the same ones that are
used in Youtube videos and on similar platforms,
working within the constraints of the paella player.
Unfortunately, one does not simply replace paella's
icons (I don't think it's imposible though), but
in the interest of time this will have to do without
any icons (that would be shown when a shortcut is
activated).

Note: This needs the next commit to work properly on multi-video
pages.
This will now track which player is currently active,
so shortcuts will only register for that video.
This makes sure that the default behaviour
(i.e. scroll by pressing the spacebar) will only
be prevented if there is an active video player on
the current page (scrolling is still prevented in
other standard cases, for example when a button is focused
– this will also not trigger the shortcut).

It should be noted that once a player is active, scrolling
with space will no longer be possible at all on the current
page instance.
Also, and this is definitely a point for further discussion:
Shortcuts will be activated once the player is loaded.
That means the user has to click or otherwise trigger
the play button first before they can use any shortcuts. This
might be annoying to some (I personally do not like that necessity).
... hopefully. Apparently, `ParseKeys` was resolving to `any`
in the previous iteration's union type. If this doesn't help,
I guess I'll just remove the first part of the union and be
content with having to add an extra object level for all keys.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:accessibility Accessibility related issues area:frontend Everything frontend related area:player Paella and its integration in Tobira area:usability Usability related issues changelog:user User facing changes javascript Pull requests that update Javascript code kind:improvement needs:research Needs research as we are lacking knowledge to make an informed decision
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add keyboard shortcuts for video player and document shortcuts alltogether
1 participant