Netflix Seek Without Pause

Seek using arrow keys without pausing the video

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Netflix Seek Without Pause
// @namespace    http://tampermonkey.net/
// @version      0.7
// @description  Seek using arrow keys without pausing the video
// @author       Plumbus
// @match        https://www.netflix.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function keyPrs($$element, $$num, $$ctrlKey, $$shiftKey, $$altKey) {

        function keyEvent($$el, $$ev) {
            var $$eventObj = document.createEvent('Events');
            $$eventObj.initEvent($$ev, true, true);

            $$eventObj.keyCode = $$num;
            $$eventObj.which = $$num;
            $$eventObj.ctrlKey = $$ctrlKey;
            $$eventObj.shiftKey = $$shiftKey;
            $$eventObj.altKey = $$altKey;

            $$el.dispatchEvent($$eventObj);
        }

        keyEvent($$element, "keydown");
        keyEvent($$element, "keypress");
        keyEvent($$element, "keyup");
        //console.log($$num);
    }

    // Rewind/Forward
    document.body.onkeydown = function(e) {
        if (document.getElementsByTagName('video').length === 0) {
            return;
        }
        if (e.keyCode == 37 || e.keyCode == 39) {
            setTimeout(function(){
                keyPrs(document.querySelector('.nf-big-play-pause'), 32, false, false, false);
            },10);

        }
    };

})();