您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add keyboard shortcuts to decrease (CTRL+,), increase (CTRL+.), and reset (CTRL+;) HTML5 video playback rate. Available playback speeds are between 0.25 to 2.0 inclusive in 0.25 increments. Speed of 1.0 is used when resetting playback speed. Note: the video playback speed menu selection on YouTube will not be affected.
当前为
- // ==UserScript==
- // @name HTML5 Video Playback Speed Control Keyboard Shortcut
- // @namespace HTML5VideoPlaybackSpeedControlKeyboardShortcut
- // @description Add keyboard shortcuts to decrease (CTRL+,), increase (CTRL+.), and reset (CTRL+;) HTML5 video playback rate. Available playback speeds are between 0.25 to 2.0 inclusive in 0.25 increments. Speed of 1.0 is used when resetting playback speed. Note: the video playback speed menu selection on YouTube will not be affected.
- // @version 1.0.2
- // @author jcunews
- // @include http://*/*
- // @include https://*/*
- // @grant none
- // ==/UserScript==
- addEventListener("keydown", function(ev) {
- var ele = document.querySelector("VIDEO"), rate;
- if (ele && ev.ctrlKey) {
- rate = rate = ele.playbackRate;
- if ((ev.key === ",") || (ev.keyIdentifier === "U+00BC")) {
- rate -= 0.25;
- if (rate < 0.25) rate = 0.25;
- } else if ((ev.key === ".") || (ev.keyIdentifier === "U+00BE")) {
- rate += 0.25;
- if (rate > 2) rate = 2;
- } else if ((ev.key === ";") || (ev.keyIdentifier === "U+00BA")) {
- rate = 1;
- }
- rate = Math.trunc(rate * 4) / 4;
- ele.playbackRate = rate;
- }
- });