JumpVideo

skip video

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         JumpVideo
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  skip video
// @author       You
// @match        https://lms.ouchn.cn/course/*/learning-activity/*
// @icon         https://www.google.com/s2/favicons?domain=ouchn.cn
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
     check();
    // Your code here...
})();

function check(){
    var retryCount = 0;
    var maxRetry = 3;
    var currentURL = window.location.href;
    var isNext = false;
    console.log("经过测试,interval 在切换视频时不会改变");
    var lock = setInterval(function(){
        console.log("开始检测是否播放完毕.....");
        let video = document.querySelector('#video video');
        if (currentURL !== window.location.href && isNext == true) {
          currentURL = window.location.href;
          isNext = false;
        }else if(currentURL == window.location.href && isNext == true){
            console.log("出现故障了,无法跳转到下一个作业,清除定时作业,lock:",lock);
            clearInterval(lock);
        }
        if(video == null || typeof video == 'undefined'){
            if(retryCount < maxRetry){
                console.log('可能是由于加载缓慢导致的未初始化问题,重试次数:'+retryCount+',最大次数:'+maxRetry)
                retryCount++;
                return;
            }else{
                console.log("判定为当前页面没有视频,直接下一个作业");
                retryCount = 0;
                $(".next").click();
                isNext = true;
                return;
            }

        }
        if (video.paused && video.duration != video.currentTime) {
            video.playbackRate=4;
            video.muted = true;
            $('.mvp-toggle-play').click();
            return;
        }else if(video.duration == video.currentTime){
            console.log("播放完毕,下一个视频");
            $(".next").click();
            isNext = true;
        }},3000);
}