mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Improve behaviour of space bar pausing/playing video
This commit is contained in:
parent
1c7ce790dc
commit
031e1c0f26
1 changed files with 6 additions and 2 deletions
|
@ -992,9 +992,13 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
|
|
||||||
const key = keyboardnavigation.getKeyName(e);
|
const key = keyboardnavigation.getKeyName(e);
|
||||||
const isKeyModified = e.ctrlKey || e.altKey || e.metaKey;
|
const isKeyModified = e.ctrlKey || e.altKey || e.metaKey;
|
||||||
|
const currentElement = document.activeElement;
|
||||||
|
|
||||||
if (!currentVisibleMenu && e.keyCode === 32) {
|
if (e.keyCode === 32) {
|
||||||
playbackManager.playPause(currentPlayer);
|
if (!currentElement.className.split(' ').includes('btnPause')) {
|
||||||
|
// If the focused button is the pause button it will already play/pause it
|
||||||
|
playbackManager.playPause(currentPlayer);
|
||||||
|
}
|
||||||
showOsd();
|
showOsd();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue