Greasy Fork is available in English.

金螳螂云学堂视频不暂停

云学堂跳过暂停

  1. // ==UserScript==
  2. // @name 金螳螂云学堂视频不暂停
  3. // @version 1.1
  4. // @description 云学堂跳过暂停
  5. // @author keke31h
  6. // @license MIT
  7. // @match *.yunxuetang.cn/*
  8. // @namespace www.31ho.com
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. var myPlayer = jwplayer();
  14.  
  15. setInterval(autoContinue, 1000);
  16. setTimeout(setPlaybackRate, 2000);
  17.  
  18. function setPlaybackRate() {
  19. if (myPlayer.getPlaybackRate() === 1) {
  20. myPlayer.setPlaybackRate(2);
  21. }
  22. }
  23.  
  24. function handleClickContinue() {
  25. var continueButton = document.querySelector(".popup button.continue-button");
  26. if (continueButton) {
  27. continueButton.click();
  28. }
  29. }
  30.  
  31. function autoContinue() {
  32. var knob = document.getElementsByClassName("jw-knob jw-reset")[0];
  33. var progress = parseFloat(knob.style.left);
  34. var scheduleText = $('#ScheduleText').html();
  35.  
  36. if (progress >= 99 && scheduleText !== '100%') {
  37. myPlayer.seek(1);
  38. }
  39.  
  40. if (scheduleText === '100%') {
  41. if (myPlayer.getState() !== "buffering") {
  42. myPlayer.seek(parseInt(player.bdPlayer.getDuration()));
  43. }
  44. }
  45.  
  46. if (myPlayer.getState() === "paused") {
  47. myPlayer.play();
  48. }
  49.  
  50. handleClickContinue();
  51. }
  52.  
  53. })();