软通视频自动播放

自动播放

当前为 2023-04-12 提交的版本,查看 最新版本

// ==UserScript==
// @name         软通视频自动播放
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  自动播放
// @author       zxpzdtom
// @match        https://*.issedu365.com/application/appcoursedetail/*
// @icon         https://eco.issedu365.com/ouselres/dashboard/static/frontend/img/favicon.ico
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    const observer = new MutationObserver((mutations) => {
        mutations.forEach((mutation) => {
            const video = mutation.target.querySelector('video');
            if (video) {
                video.addEventListener('pause', () => {
                    console.log('video paused, restarting...');
                    video.play();
                    video.muted = true
                });

                document.addEventListener('fullscreenchange', () => {
                    console.log('document.fullscreenElement', document.fullscreenElement);
                    if (document.fullscreenElement) {
                        document.exitFullscreen();
                    }
                });
                observer.disconnect();
            }
        });
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true,
    });

    setInterval(() => {
        const btn = document.querySelector('body > div.el-dialog__wrapper > div > div.el-dialog__footer > span > button');
        const viddeo = document.querySelector("video");
        if (btn) {
            btn.click();
        }
        const nextBtn = document.querySelector('body > div.el-message-box__wrapper > div > div.el-message-box__btns > button');
        if (nextBtn) nextBtn.click();
    }, 5000)
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址