Skip to content
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

fix(web): fix escape key not closing video player after seeking #16860

Merged
merged 2 commits into from
Mar 25, 2025

Conversation

Snowknight26
Copy link
Contributor

Description

When video controls have focus, escape and space key presses aren't propagated and therefore the video can't be closed or paused, respectively. Each time something causes the video to start re-playing (seeking, pause then unpause, etc.), the video element (and not the controls element) is now focused, allowing the parent keydown handlers to kick in.

Fixes #16778

How Has This Been Tested?

  • Press escape after seeking
  • Press space after seeking

Screenshots (if appropriate)

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

@Snowknight26
Copy link
Contributor Author

I'm not sold that this is actually a bug. This might be how the browser controls element handles event propagation. This change might introduce some accessibility concerns if the expectation is that after seeking you can use the keyboard to continue using the controls (which now requires an extra tab to focus back on the controls after each 'onplaying' event firing).

@Snowknight26
Copy link
Contributor Author

https://html.spec.whatwg.org/multipage/media.html#user-interface

If the user agent exposes a user interface to the user by displaying controls over the media element, then the user agent should suppress any user interaction events while the user agent is interacting with this interface. (For example, if the user clicks on a video's playback control, mousedown events and so forth would not simultaneously be fired at elements on the page.)

Not sure if that applies to "escape" though.

¯\_(ツ)_/¯

@alextran1502 alextran1502 enabled auto-merge (squash) March 25, 2025 13:40
@alextran1502 alextran1502 merged commit b8bc11b into immich-app:main Mar 25, 2025
40 checks passed
@Snowknight26 Snowknight26 deleted the fix-video-escape branch March 25, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Escape key doesn't work after using video seekbar
3 participants