Greasy Fork

Greasy Fork is available in English.

百度网盘视频加速播放

加速百度网盘在线播放视频的速度

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         百度网盘视频加速播放
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  加速百度网盘在线播放视频的速度
// @author       HollowME
// @match        https://pan.baidu.com/play/*
// @grant        none
// ==/UserScript==


(function() {
    'use strict';
    // Your code here...
    var videoToolbar = document.getElementById('video-toolbar');

    var btnSpeedUp = document.createElement('a');
    btnSpeedUp.className = 'g-button';
    btnSpeedUp.setAttribute('title','加速');
    btnSpeedUp.setAttribute('style','height:32px; margin:0 5px; padding:0 0 0 10px; cursor:pointer;');

    var iconSpeedUp = document.createElement('em');
    iconSpeedUp.className = 'icon icon-speed';
    iconSpeedUp.title = '加速';

    var spanTxt = document.createElement('span');
    spanTxt.className = 'text';
    spanTxt.innerText = '加速';

    var gBtnRight = document.createElement('span');
    gBtnRight.className = 'g-button-right';
    gBtnRight.append(iconSpeedUp,spanTxt);
    gBtnRight.setAttribute('style','padding:0 10px 0 0');

    var rateNum = document.createElement('input');
    rateNum.type = 'number';
    rateNum.id = 'ratenum';
    rateNum.setAttribute('step', '0.2');
    rateNum.setAttribute('style','width:44px; height:32px; padding:0px 0px 0px 12px; margin:0px 0px 0px 3px; border:1px solid #c3eaff');
    rateNum.value = '1';
    rateNum.className = 'g-button';

    btnSpeedUp.onclick = function setPlayerRate() {
        var player = videojs.getPlayers("video-player");
        player.html5player.tech_.setPlaybackRate(document.getElementById('ratenum').value);
    }

    videoToolbar.childNodes[3].append(btnSpeedUp,rateNum);
    btnSpeedUp.appendChild(gBtnRight);
})();