onlinedu自动播放

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

目前为 2020-12-25 提交的版本。查看 最新版本

// ==UserScript==
// @name         onlinedu自动播放
// @namespace    c-h.cc
// @version      0.3
// @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="uul" style="border:1px solid black;width:200px;height:500px;overflow:auto;position:fixed;left:0;top:200px;background:white"><ul><li>已启动</li></ul></div>')
    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
    }
})();