Greasy Fork is available in English.
在哔哩哔哩网站上播放视频时,按下x键减速播放,按下c键加速播放,按下z原速播放或上一次速度播放。每次步进为0.2。
当前为
// ==UserScript==
// @name B站倍播快捷键_好用!
// @version 6.7.8
// @description 在哔哩哔哩网站上播放视频时,按下x键减速播放,按下c键加速播放,按下z原速播放或上一次速度播放。每次步进为0.2。
// @description 带记忆功能。按键记忆:z、x、c这三个键在键盘上依次排列,即原速、减速、加速。这样就好记多了。此外按下f全屏播放。
// @description 例如:按下x键2次,当前播放速度为0.6,紧接着再按下z键,这时候回到1倍速,再按下z键,这时再回到0.6倍速。
// @author Alan996
// @icon https://i1.hdslb.com/bfs/face/a809a3b8407840ae00032360108261fcf503d38a.jpg@96w_96h_1c_1s.webp
// @match https://www.bilibili.com/*
// @grant GM_setValue
// @grant GM_getValue
// @license GPL
// @namespace hahahahahahahahalahahahahahaha
// ==/UserScript==
(function() {
'use strict';
var videoElement = document.querySelector('video');
var a = GM_getValue('a', 10);
var b = GM_getValue('b', 10);
videoElement.playbackRate = a/10;
document.addEventListener('keydown', function(event) {
var c = false;
if (event.code === 'KeyX') {
a -= 2;
} else if (event.code === 'KeyC') {
a += 2;
} else if (event.code === 'KeyZ') {
c = true;
a = videoElement.playbackRate === 1 ? b : 10;
}
if (a < 2) {
a = 2;
} else if (a > 80) {
a = 80;
}
GM_setValue('a', a);
videoElement.playbackRate = a/10;
if(!c){
b = a;
GM_setValue('b', b);
}
});
})();