超星 mooc禁止自动暂停、自动下一集、自动两倍速、自动播放 mooc1.chaoxing.com

此脚本仅适用于 mooc1.chaoxing.com 这个网址

目前为 2021-11-24 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 超星 mooc禁止自动暂停、自动下一集、自动两倍速、自动播放 mooc1.chaoxing.com
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.5
  5. // @description 此脚本仅适用于 mooc1.chaoxing.com 这个网址
  6. // @author tomiaa
  7. // @match *://mooc1.chaoxing.com/*
  8. // @icon https://www.google.com/s2/favicons?domain=chaoxing.com
  9. // @grant none
  10.  
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. top.video = null;
  15. function init() {
  16. if (window !== top) return;
  17. const fn = () => {
  18. video = top?.frames?.[0]?.frames?.[0]?.document?.getElementById?.('video_html5_api');
  19. if (!video) {
  20. setTimeout(fn, 2000)
  21. return;
  22. }
  23. video.volume = 0
  24. video.autoplay = true
  25. video.defaultPlaybackRate = 2
  26. video.playbackRate = 2
  27. function play() {
  28. if (!video.ended) setTimeout(() => {
  29. video.play()
  30. }, 4)
  31. }
  32. video.onpause = play
  33. // video.onwaiting=()=>{
  34. // console.log('onwaiting');
  35. // top?.frames?.[0]?.frames?.[0]?.document.querySelector('.vjs-play-control').click();
  36. // }
  37. video.onended = () => {
  38. document.getElementsByClassName('orientationright ')?.[0]?.click?.()
  39. console.log('ended');
  40. video.onwaiting = null;
  41. video.onpause = null
  42. setTimeout(fn, 2000)
  43. }
  44. setInterval(() => {
  45. if(!video.paused) video.play();
  46. },4000)
  47. video.play();
  48. }
  49. fn()
  50. }
  51. window.onload = init;
  52.  
  53. })()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址