网页继续教育万能自动播放视频倍数,各类专业技术人员,教师,会计,医学继续教育公需课专业课。。。。。

各类专业技术人员,教师,会计,医学继续教育公需课专业课。

目前为 2025-01-11 提交的版本。查看 最新版本

// ==UserScript==
// @name         网页继续教育万能自动播放视频倍数,各类专业技术人员,教师,会计,医学继续教育公需课专业课。。。。。
// @namespace    一只蚂蚁而已
// @version      1.0
// @license      MIT
// @description  各类专业技术人员,教师,会计,医学继续教育公需课专业课。
// @author       各种继续教育学习
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let currentRate = 1.0;
    let videoPlaying = false;

    function setPlaybackRate(rate) {
        const videos = document.querySelectorAll('video');
        videos.forEach(video => {
            video.playbackRate = rate;
            video.play().catch(err => {}); 
        });
    }

    function checkAndPlayVideo() {
        const videos = document.querySelectorAll('video');
        videos.forEach(video => {
            if (video.paused) {
                video.play().catch(err => {}); 
            }
        });
    }

    function createModal() {
        const modal = document.createElement('div');
        modal.style.position = 'fixed';
        modal.style.left = '0'; 
        modal.style.top = '50%';
        modal.style.transform = 'translateY(-50%)';
        modal.style.backgroundColor = 'white';
        modal.style.padding = '20px';
        modal.style.zIndex = '1000';
        modal.style.borderRadius = '5px'; 
        modal.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.1)';
        modal.style.width = '300px'; 
        modal.style.height = 'auto';
        modal.style.textAlign = 'center'; 
        modal.style.fontFamily = 'Arial, sans-serif'; 
        modal.style.border = '2px solid #ccc'; 
        modal.style.backgroundColor = '#f9f9f9'; 


        const selectLabel = document.createElement('label');
        selectLabel.textContent = '选择倍速 (1-16): ';
        modal.appendChild(selectLabel);

        const select = document.createElement('select');
        for (let i = 1; i <= 16; i++) {
            const option = document.createElement('option');
            option.value = i;
            option.textContent = `${i}x`;
            select.appendChild(option);
        }
        select.value = currentRate;
        modal.appendChild(select);

  
        const confirmButton = document.createElement('button');
        confirmButton.textContent = '确认';
        confirmButton.style.marginTop = '10px';
        confirmButton.onclick = function() {
            currentRate = parseFloat(select.value);
            setPlaybackRate(currentRate);
        };
        modal.appendChild(confirmButton);


        const closeButton = document.createElement('button');
        closeButton.textContent = '关闭窗口';
        closeButton.style.marginLeft = '10px';
        closeButton.style.marginTop = '10px';
        closeButton.onclick = function() {
            modal.remove();
        };
        modal.appendChild(closeButton);


        const infoText = document.createElement('p');
        infoText.style.marginTop = '20px';
        infoText.innerHTML = `
            <strong>倍速需谨慎</strong><br>
            已启动视频加速<br>
            当前加速倍速为:<strong>${currentRate}x</strong><br>
            不是所有的学习平台都可以进行倍数<br>
            该平台是否支持请自行测试<br>
            若没记录则表示为不可以<br>
            <span style="color: red;">不想学习且需要帮忙代学习联系 v:study-088</span>
        `;
        modal.appendChild(infoText);

        return modal;
    }


    const modal = createModal();
    document.body.appendChild(modal);

    setPlaybackRate(currentRate);


    setInterval(checkAndPlayVideo, 1000); 
})();

QingJ © 2025

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