Greasy Fork

Greasy Fork is available in English.

华为ilearnX平台视频自动播放,自动下一章,自动静音

华为ilearnX平台视频自动播放下一章自动静音,鸣谢@明钊

当前为 2021-01-16 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        华为ilearnX平台视频自动播放,自动下一章,自动静音
// @namespace   [email protected]
// @version      0.51
// @description 华为ilearnX平台视频自动播放下一章自动静音,鸣谢@明钊
// @author       azheng9929
// @match         https://ilearningx.huawei.com/courses/*
// @grant        unsafewindow
// @grant        GM_xmlhttpRequest
// @grant        GM_getValue
// @grant        GM_setValue
// ==/UserScript==
window.addEventListener("load", Greasemonkey_main, false);

function Greasemonkey_main() {
    setInterval(function () {
        //Because of page lodaing speed, we check page type in interval.
        var v1 = document.querySelector('video');

        //Handle non-video page
        if (v1 == null) {
            //By default, just pass.
            document.querySelector('.sequence-nav-button.button-next').click();
        }

        //Handle video page
        if (document.querySelector('video') != null) {

            //Click next
            if (document.querySelector('video').ended == true) {
                document.querySelector('.sequence-nav-button.button-next').click();
            }

            //Play
            if (document.querySelector('video').paused == true) {
                document.querySelector('video').play();
            }

            //Mute
            if(document.querySelector('video').volume > 0){
                document.querySelector('video').volume=0;
            }
        }
    }
        //判断播放进度是否到达100%
        , 10000)
}