Greasy Fork

来自缓存

Greasy Fork is available in English.

高校教师培训中心加速连续播放-DrS

随手搞搞,能用则用。

当前为 2022-05-10 提交的版本,查看 最新版本

// ==UserScript==
// @name         高校教师培训中心加速连续播放-DrS
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  随手搞搞,能用则用。
// @author       DrS
// @license      AGPL License
// @match        https://onlinenew.enetedu.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=enetedu.com
// @grant        none
// ==/UserScript==

(function() {
    var urlInfos = window.location.href.split("/");

    var urlTip = urlInfos[urlInfos.length - 1].split("?")[0];
    console.log("当前地址:"+urlTip)
    if (urlTip == "VideoPlayHFive"  ) { //视频页面
        console.log("当前任务: 看视频")
        seeVideo();
    } else if (urlTip == "course.aspx" ||  urlTip == "cme.aspx") { //课程列表页面
        console.log("当前任务: 课程播放列表")
        OnlineCourse();
    } else {
        console.log("其它情况")
    }

    function seeVideo(){
        setTimeout(function(){ //这是速率调整部分
            h5_player.setVolume(0.1);
            h5_player.setPlaybackRate(4);
        }, 5000);
        setInterval(function(){
            ClosePopup();
            if(h5_player.isEnded){
                if ($("li.ellipsis:not(.class-green)",window.parent.document).css("background-color")=="rgb(204, 197, 197)"){
                    console.log("第一个是灰色")
                    $("li.ellipsis:not(.class-green)",window.parent.document)[1].click();
                }else{
                    console.log("第一个不是灰色")
                    $("li.ellipsis:not(.class-green)",window.parent.document)[0].click();
                }
            }

        }, 3000);
        //
    }

    function OnlineCourse(){
        //这个代码段暂时什么也不做
        //addSkipbtn();
        function addSkipbtn(){//插入按钮快进视频按钮
            let alink=document.createElement("a");
            alink.innerHTML='快进视频';
            alink.onclick=function(event){

                //skipVideo();
            };
            document.getElementsByClassName("nav25")[0].children[0].append(alink);

        }
    }

})();