对于某平台播放的简要修改代码

F12直接上。
注:Internet Explorer 9及以上可用。
Blink 自便。

var ti = $("body");
var video = $(".catalogue_ul1 li[id*=video-] .catalogue_title");
var i = 1;
var v = 1;
var startTime = new Date().getTime(); //开始时间
var endTime = startTime + 60*25*1000; //结束时间 25分钟
video.css("color", "blue");
console.log("已选取" + video.length + "个小节,并已用蓝色标明");
setTimeout(function () {
    $('.speedTab15').click();
    $('.volumeIcon').click();
    console.log("已进行静音和1.5倍加速");
}, 3000);
ti.on("DOMNodeInserted", function (e) {
    var now = new Date().getTime();
    if(now-endTime >= 0){
        ti.off("DOMNodeInserted");
        if(window.confirm("已观看25分钟,是否返回首页?")){
            window.location.href = "https://onlineh5.zhihuishu.com/onlineWeb.html#/studentIndex";
        }
    }
 
    if (e.target.textContent == "关闭") {
        console.log("检测到第" + i + "个弹题窗口");
        window.setTimeout(function () {
            // document.getElementById("tmDialog_iframe").contentWindow.document.getElementsByClassName("answerOption")[0].getElementsByTagName("input")[0].click();
            $('#tmDialog_iframe')[0].contentWindow.$('.answerOption input[type="radio"]')[0].click();
            setTimeout(function () {
                $(".popbtn_cancel").click();
                console.log("已关闭");
            }, 1000);
        }, 2000);
        i++;
    } else if (e.target.textContent == "本节视频,累计观看时间『100%』") {
        console.log("检测到视频观看完成,准备跳到下一节");
        $('.next_lesson_bg').find('a').trigger('click');
        console.log("已跳转");
        setTimeout(function () {
            $('.volumeIcon').click();
            $('.speedTab15').click();
            console.log("已进行静音和1.5倍加速");
        }, 6000);
        v++;
        console.log("目前播放了" + v + "个视频");
    }
});
 
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值