Greasy Fork is available in English.

超星倍速破解

cx 视频倍速破解脚本

  1. // ==UserScript==
  2. // @name 超星倍速破解
  3. // @namespace https://enncy.cn
  4. // @version 0.4
  5. // @description cx 视频倍速破解脚本
  6. // @author enncy
  7. // @match **://**/**
  8. // @run-at document-end
  9. // @grant unsafeWindow
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. let videojs = unsafeWindow.videojs
  16. let Ext = unsafeWindow.Ext
  17. if(videojs && Ext){
  18. console.log("倍速破解启动")
  19. console.log("videojs.hook")
  20. videojs.hook('beforesetup', function(videoEl, options) {
  21. console.log(options)
  22. options.playbackRates=[1, 1.25, 1.5, 2,4,8,12,16]
  23. return options;
  24. });
  25. console.log("Ext.define")
  26. Ext.define("ans.VideoJs",{
  27. override:"ans.VideoJs",
  28. constructor: function (b) {
  29. b = b || {};
  30. var e = this;
  31. e.addEvents(["seekstart"]);
  32. e.mixins.observable.constructor.call(e, b);
  33. var c = videojs(b.videojs, e.params2VideoOpt(b.params), function () {});
  34. Ext.fly(b.videojs).on("contextmenu", function (f) {
  35. f.preventDefault();
  36. });
  37. Ext.fly(b.videojs).on("keydown", function (f) {
  38. if (f.keyCode == 32 || f.keyCode == 37 || f.keyCode == 39 || f.keyCode == 107) {
  39. f.preventDefault();
  40. }
  41. });
  42. if (c.videoJsResolutionSwitcher) {
  43. c.on("resolutionchange", function () {
  44. var g = c.currentResolution(),
  45. f = g.sources ? g.sources[0].res : false;
  46. Ext.setCookie("resolution", f);
  47. });
  48. }
  49. // var a = b.params && b.params.doublespeed ? 2 : 1;
  50. // c.on("ratechange", function () {
  51. // var f = c.playbackRate();
  52. // if (f > a) {
  53. // c.pause();
  54. // c.playbackRate(1);
  55. // }
  56. // });
  57. },
  58. })
  59. }
  60. // Your code here...
  61. })();