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+]'

Version vom 25.01.2021. Aktuellste Version

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

// ==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...
})();