-
Notifications
You must be signed in to change notification settings - Fork 0
/
破解禁止倍速关键代码
40 lines (40 loc) · 1.62 KB
/
破解禁止倍速关键代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function rateHack() {
try {
hack();
window.document.addEventListener("readystatechange", hack);
window.addEventListener("load", hack);
} catch (e) {
console.error(e.message);
}
}
function hack() {
if (typeof videojs !== "undefined" && typeof Ext !== "undefined") {
logs.addLog("debug", "倍速破解启动");
Ext.define("ans.VideoJs", {
override: "ans.VideoJs",
constructor: function (b) {
b = b || {};
const e = this;
e.addEvents(["seekstart"]);
e.mixins.observable.constructor.call(e, b);
const c = videojs(b.videojs, e.params2VideoOpt(b.params), function () {
});
Ext.fly(b.videojs).on("contextmenu", function (f) {
f.preventDefault();
});
Ext.fly(b.videojs).on("keydown", function (f) {
if (f.keyCode === 32 || f.keyCode === 37 || f.keyCode === 39 || f.keyCode === 107) {
f.preventDefault();
}
});
if (c.videoJsResolutionSwitcher) {
c.on("resolutionchange", function () {
const g = c.currentResolution();
const f = g.sources ? g.sources[0].res : false;
Ext.setCookie("resolution", f);
});
}
}
});
}
}