Created
April 1, 2019 10:09
-
-
Save otizis/2f54a5df2e54de5d403ab2e2326f91ff to your computer and use it in GitHub Desktop.
百度网盘播放调速
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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