// ==UserScript== // @name 百度网盘视频倍速 // @namespace http://www.skji.net/ // @version 1.1 // @description 自由调整百度网盘在线播放视频倍速 // @author E6ther // @homepage https://github.com/E6ther/BaiduPan-VideoRate // @supportURL https://github.com/E6ther/BaiduPan-VideoRate/issues // @match *://pan.baidu.com/* // @grant none // @run-at document-end // @downloadURL none // ==/UserScript== (function () { 'use strict'; let platRateCSS = { "playRateMainCSS": { "background-color": "rgba(0, 70, 128, 0.1)", "border": "1px solid rgba(0, 70, 128, 0.12)", "width": "25px", "height": "25px", "border-radius": "13px", "transition": "all 0.2s", "position": "absolute", "top": "18%", "right": "2px", "z-index": "999999" }, "playRateMainHCSS": { "background-color": "rgba(0, 70, 128, 0.5)", "border": "1px solid rgba(0, 70, 128, 0.52)", "width": "120px", "height": "100px", "border-radius": "13px", "transition": "all 0.1s", "position": "absolute", "top": "18%", "right": "2px", "z-index": "999999" }, "playRateJiCSS": { "color": "rgba(0, 70, 128, 0.3)", "font-weight": "bold", "position": "absolute", "top": "50%", "left": "50%", "transform": "translate(-50%,-50%)" }, "playRateContentCSS": { "position": "absolute", "top": "50%", "left": "50%", "transform": "translate(-50%,-50%)" }, "playRateTextCSS": { "color": "rgba(255, 255, 255, 1)", "font-size": "16px", "text-align": "center", "-webkit-user-select": "none", "-moz-user-select": "none", "-ms-user-select": "none", "user-select": "none" }, "playRateInputRangeCSS": { "width": "100px", "margin": "5px 0 0 0" }, "playRateInputContentCSS": { "display": "flex", "align-items": "center", "justify-content": "space-between" }, "playRateInputCSS": { "border": "1px solid rgba(0, 70, 128, 0.57)", "outline": "none", "border-radius": "3px", "padding": "1px", "width": "48px", "height": "23px", "box-sizing": "border-box" }, "playRateInputInitCSS": { "border": "1px solid rgba(0, 70, 128, 0.57)", "background-color": "rgba(0, 70, 128, 0.1)", "color": "rgba(255, 255, 255, 1)", "border-radius": "3px", "padding": "0 7px", "height": "23px", "box-sizing": "border-box" } } let Rate = localStorage.getItem("Rate"); // 播放速度 if (!Rate) { Rate = 1; } let RateLevel; let video_main = $(".video-main"); let video_content_list; if (video_main[0]) { console.log("百度网盘视频倍速 - 已获取到视频"); let myVar = setInterval(function () { if (window.videojs) { let video = window.videojs.getPlayers("video-player").html5player; if (video) { videojs.getPlayers("video-player").html5player.tech_.setPlaybackRate(Rate); clearInterval(myVar); console.log("百度网盘视频倍速 - 调整倍速成功"); video_content_list = $(".video-list-thumbnail"); playRateControl(); } } }, 1000); } else { console.log("百度网盘视频倍速 - 未获取到视频"); } function playRateControl() { let body = $("body"); let playRateMain = $("
"); let playRateJi = $("