JumpVideo

skip video

当前为 2023-06-06 提交的版本,查看 最新版本

// ==UserScript==
// @name         JumpVideo
// @namespace    http://tampermonkey.net/
// @version      0.5
// @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;
    setInterval(function(){
        console.log("开始检测是否播放完毕.....");
        let video = document.querySelector('#video video');
        if(video == null || typeof video == 'undefined'){
            if(retryCount < maxRetry){
                console.log("可能是由于加载缓慢导致的未初始化问题,重试,重试次数${retryCount},最大次数${maxRetry}")
                retryCount++;
                return;
            }else{
                console.log("判定为当前页面没有视频,直接下一个作业");
                retryCount = 0;
                $(".next").click();
            }

        }
        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();
        }},3000);
}

QingJ © 2025

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