From 7989e92f2b086bb6abb4fbce83b7596e05243ee4 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 28 Jul 2019 04:37:36 +0000 Subject: [PATCH] assets/scripts.js: Fix Space not unpausing with visible controls When the video controls are visible, the video is paused, and the video element is focused, pressing Space would unpause the video and then immediately pause it again. --- assets/scripts.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/scripts.js b/assets/scripts.js index 7d1b35e..dec8f84 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -416,6 +416,10 @@ window.onload = function() { if (e.code == 'Space') togglePlayPause(); }; + video_selector.onkeydown = function(e) { + if (e.code == 'Space') + e.preventDefault(); + }; document.onkeydown = function (e) { if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)