How do I capture keyboard events while watching an HTML5 video in fullscreen mode?
I need to know when the user presses the escape key when watching an HTML5 video in fullscreen mode. Unfortunately any configured listeners on the document don't apply since when the user is watching an HTML5 video in fullscreen mode the system focus is on the native video player rather than the browser. An alternative is listening for when focus reverts back from the native video player to the browser, but I'm unsure as to how I would capture this. document.addEventListener('keydown', function (e) { console.log(e.keyCode); }, false); The above successfully logs to the console when I press