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

Greasy fork 爱吃馍镜像

学习通自动播放视频

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

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

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

公众号二维码

扫码关注【爱吃馍】

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

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

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

公众号二维码

扫码关注【爱吃馍】

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

// ==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);
    };
})();