Skip to content

Instantly share code, notes, and snippets.

@otizis
Created April 1, 2019 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otizis/2f54a5df2e54de5d403ab2e2326f91ff to your computer and use it in GitHub Desktop.
Save otizis/2f54a5df2e54de5d403ab2e2326f91ff to your computer and use it in GitHub Desktop.
百度网盘播放调速
// ==UserScript==
// @name 百度网盘播放调速
// @namespace http://jaxer.cc/
// @version 1.0
// @description 百度网盘播放调速,1.5倍
// @author jaxer
// @match https://pan.baidu.com/play/video
// @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js
// @grant none
// ==/UserScript==
Element.prototype._attachShadow = Element.prototype.attachShadow;
Element.prototype.attachShadow = function (){
return this._attachShadow({mode:"open"});
};
(function() {
'use strict';
$("<select style='position:fixed;left:1rem;top:5rem;width:5rem'><option>1</option><option>1.2</option><option>1.5</option><option>1.8</option></select>")
.appendTo("html")
.on("change",function(){
var rate = $(this).val()
console.log(rate)
var video = $("#video-root")[0].shadowRoot.querySelector("video");
video.playbackRate = rate;
document.title = "播放速度"+ video.playbackRate
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment