From 8443063fc48ef5d4a9d517c9999e17477b7a7123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Wed, 16 Dec 2020 21:58:30 -0500 Subject: Hotkeys.js: improve fullscreen --- youtube/static/js/hotkeys.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube/static/js/hotkeys.js b/youtube/static/js/hotkeys.js index d8a2f53..2cd2336 100644 --- a/youtube/static/js/hotkeys.js +++ b/youtube/static/js/hotkeys.js @@ -26,8 +26,8 @@ function onKeyDown(e) { } else if (c == "f") { e.preventDefault(); - if (document.fullscreenElement) document.exitFullscreen(); - else v.requestFullscreen(); + if (document.fullscreenElement && document.fullscreenElement.nodeName == 'VIDEO') {document.exitFullscreen();} + else {v.requestFullscreen()}; } else if (c == "m") { if (v.muted == false) {v.muted = true;} -- cgit v1.2.3