Greasy Fork

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

自动播放下一集,自动二倍速度

目前为 2020-09-25 提交的版本。查看 最新版本

// ==UserScript==
// @name         重庆继续教育选修小节自动播放
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  自动播放下一集,自动二倍速度
// @author       moxiaoying
// @match        https://cqrl.21tb.com/els/html/courseStudyItem/courseStudyItem.learn.do*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const iframe = document.getElementsByClassName('url-course-content').aliPlayerFrame.contentWindow;
    setInterval(function(){
        let next_button = iframe.document.body.getElementsByClassName('next-button');
        if(next_button.length!=0){
        next_button[0].click();
        }
        console.log('检测是否播放完毕');
    },0.5*60*1000);
    setTimeout(function(){
        let ul = iframe.document.body.getElementsByClassName('rate-list');
        if(ul.length!=0){
            ul[0].getElementsByTagName('li')[0].click();//设置2倍数
            console.log('设置2倍数');
        }
    },0.1*60*1000);
    // Your code here...
})();