🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

学习通自动播放视频

仅支持任务点全为视频的自动播放,静音播放,自动连播,自动下一个任务点

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         学习通自动播放视频
// @namespace    adog
// @version      1.0
// @description  仅支持任务点全为视频的自动播放,静音播放,自动连播,自动下一个任务点
// @author       a6op
// @match        https://mooc1.chaoxing.com/mycourse/studentstudy?*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...

    findtask();
        var timefind=setInterval(function(){
                if(document.getElementById("iframe").contentWindow.document.getElementsByTagName("iframe")[document.getElementById("iframe").contentWindow.document.getElementsByTagName("iframe").length-1].contentWindow.document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal")[0].getAttribute("aria-valuenow") == 100){
                        findtask();
                };
            },10000);
    function findtask(){
        setTimeout(function(){
            document.getElementsByClassName("catalog_points_yi prevTips")[0].parentNode.children[0].click();
        },1000);
        playvideo();
        setTimeout(function(){
            if(document.getElementsByClassName("catalog_points_yi prevTips").length==0){clearInterval(timefind);}
        },1000);
    };
    function playvideo(){
        var videolist=0;
        var timeplay=setInterval(function(){
            if(videolist>=document.getElementById("iframe").contentWindow.document.getElementsByTagName("iframe").length){clearInterval(timeplay);};
            if(document.getElementById("iframe").contentWindow.document.getElementsByClassName("ans-attach-ct")[videolist].className !="ans-attach-ct ans-job-finished"){
                    setTimeout(function(){
                        document.getElementById("iframe").contentWindow.document.getElementsByTagName("iframe")[videolist].contentWindow.document.getElementById("video").children[0].muted=true;
                    },3000);
                    setTimeout(function(){
                        document.getElementById("iframe").contentWindow.document.getElementsByTagName("iframe")[videolist].contentWindow.document.getElementById("video").children[0].play();
                    },3000);
                }
            else
            {videolist++;}
            },3000);
    };
})();