KockaAdmiralac / Arrow keys for moving within video

// ==UserScript==
// @name         Arrow keys for moving within video
// @namespace    https://kocka.tech
// @version      0.1
// @description  Lets you seek backwards/forwards within a video you're watching from your file system.
// @author       KockaAdmiralac
// @match        file://**/*.mp4
// @icon         https://www.google.com/s2/favicons?sz=64&domain=undefined.
// @grant        none
// @license      MIT
// ==/UserScript==

document.addEventListener('keydown', function(event) {
    var video = document.getElementsByTagName('video')[0];
    if (event.key === 'ArrowLeft') {
        video.currentTime -= 5;
    } else if (event.key === 'ArrowRight') {
        video.currentTime += 5;
    }
});