HTML5 video speed controller and preferred speed adjustment

HTML5 video speed controller and preferred speed adjustmen, increase video speed by 0.1 with'ctr+.'decrease video speed by 0.1 with 'ctrl+\'reset video speed with' ctrl+,'set video speed to 1.15 with 'ctrl+/' set video speed to 1.35 with' ctrl+:'set video speed to 1.65 with 'ctrl+]'

2021-01-25 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         HTML5 video speed controller and preferred speed adjustment
// @namespace    http://tampermonkey.net/
// @version    1.1
// @description HTML5 video speed controller and preferred speed adjustmen, increase video speed by 0.1 with'ctr+.'decrease video speed by 0.1 with 'ctrl+\'reset video speed with' ctrl+,'set video speed to 1.15 with 'ctrl+/' set video speed to 1.35 with' ctrl+:'set video speed to 1.65 with 'ctrl+]'
// @author      我的名字十二个字不信你数 
// @include  *
// @grant        none
// ==/UserScript==
(function () {
    'use strict';
    var div = document.createElement("div");
    div.innerHTML = '<div id="speeddiv" style="position:fixed;left:5px;top:5px;z-index:9999999;font-size:1.0em;display:none"></div>'
    document.getElementsByTagName('body')[0].appendChild(div);
    var itime='';
    document.onkeydown = function (event) {
            if(!document.querySelector('video')) return;
            event = event || window.event
            var fg=false;
            if (event.keyCode == 190 && event.ctrlKey) {
                document.querySelector('video').playbackRate += 0.1
                fg=true
            }
            if (event.keyCode == 226 && event.ctrlKey) {
                document.querySelector('video').playbackRate -= 0.1
                fg=true
            }
            if (event.keyCode == 188 && event.ctrlKey) {
                document.querySelector('video').playbackRate = 1
                fg=true
            }
            if (event.keyCode == 191 && event.ctrlKey) {
                document.querySelector('video').playbackRate = 1.15
                fg=true
            }
            if (event.keyCode == 186 && event.ctrlKey) {
                document.querySelector('video').playbackRate = 1.35
                fg=true
            }
            if (event.keyCode == 221 && event.ctrlKey) {
                document.querySelector('video').playbackRate = 1.65
                fg=true
            }
            if(fg){
              if(itime!==''){
                clearTimeout(itime);
              }
              document.getElementById('speeddiv').style.display='block'
              document.getElementById('speeddiv').innerHTML='speed:'+document.querySelector('video').playbackRate.toFixed(2)
              itime=setTimeout(function(){
                  document.getElementById('speeddiv').style.display='none'
              },2000)
            }
        }
        // Your code here...
})();