From 031e1c0f2681af65f824889f4493a857eb0d9bd0 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Mar 2021 19:21:11 -0400 Subject: [PATCH] Improve behaviour of space bar pausing/playing video --- src/controllers/playback/video/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index d74bc103e7..0834f492af 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -992,9 +992,13 @@ import { appRouter } from '../../../components/appRouter'; const key = keyboardnavigation.getKeyName(e); const isKeyModified = e.ctrlKey || e.altKey || e.metaKey; + const currentElement = document.activeElement; - if (!currentVisibleMenu && e.keyCode === 32) { - playbackManager.playPause(currentPlayer); + if (e.keyCode === 32) { + if (!currentElement.className.split(' ').includes('btnPause')) { + // If the focused button is the pause button it will already play/pause it + playbackManager.playPause(currentPlayer); + } showOsd(); return; }