Greasy Fork

Greasy Fork is available in English.

重庆继续教育选修小节自动播放

只支持选修小节自动播放

当前为 2020-09-25 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         重庆继续教育选修小节自动播放
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  只支持选修小节自动播放
// @author       moxiaoying
// @match        http*://cqrl.21tb.com/els/html/courseStudyItem/courseStudyItem.learn.do*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    setTimeout(function(){
        const iframe = document.querySelector('.url-course-content').contentDocument;
        let player = iframe.querySelector('.player-container');
        let m = new MutationObserver(function(mutationsList, observer){
            // 播放完后点击下一节
            iframe.querySelector('.next-button').click();
            console.log('检测是否播放完毕');
        });
        m.observe(player,{childList: true});
        // 设置2倍数
        iframe.querySelector('.rate-list > li[data-rate="2.0"]').click()
    },0.05*60*1000);
    // Your code here...
})();