onlinedu自动播放

自动点击播放器元素以继续播放

当前为 2020-12-25 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         onlinedu自动播放
// @namespace    c-h.cc
// @version      0.5
// @description  自动点击播放器元素以继续播放
// @author       JKRaks
// @match        www.onlinedu.org.cn
// @include      http://www.onlinedu.org.cn/*
// @include      https://www.onlinedu.org.cn/*
// @grant        none
// @require      http://libs.baidu.com/jquery/2.0.0/jquery.min.js
// ==/UserScript==

(function() {
    $('body').append('<div id="ddiv" style="border:1px solid black;width:220px;height:400px;overflow:auto;position:fixed;left:0;top:200px;background:white"><a href="javascript:" id="closeDivBtn">关闭</a><a href="javascript:" id="clearDivBtn">清空</a><ul id="uul" style="list-style:\'✔\'"><li id="startLi">已启动</li></ul></div>')

    setTimeout(function(){
        var $Lst=$(".el-progress__text")
        for(var i=0;i<$Lst.length;i++){
            if($Lst.eq(i).text()!="100%"){
                $Lst.eq(i).parent().parent().parent().parent().prev().find("h3").click()
                $Lst.eq(i).parent().parent().click()
                $Lst.eq(i).click()
                return;
            }
        }
    },3000);

    function selectClass(){

    }

    setInterval(function(){
        try{
            var vdo =$('video').get(0)
            var State = vdo.paused
            if(State){
                ck()
            }
        }
        catch(err){}
    },300)

    function ck(){
        $(".dplayer-video-wrap").click()
        $("#uul li:eq(0)").before('<li>'+getNow()+'重新播放</li>')
    }

    function getNow() {
        var myDate = new Date();
        var month=myDate.getMonth()+1;
        var date=myDate.getDate();
        var h=myDate.getHours();
        var m=myDate.getMinutes();
        var s=myDate.getSeconds();
        var now = month+'/'+date+' '+h+':'+m+':'+s;
        return now
    }

    $("#closeDivBtn").click(function(){
        $("#ddiv").remove()
    })
    $("#clearDivBtn").click(function(){
        $("#uul li :not(:last)").remove()
    })
})();