Greasy Fork

Greasy Fork is available in English.

奥鹏教育视频刷课-静音-自动下一课

奥鹏教育视频

当前为 2021-04-15 提交的版本,查看 最新版本

// ==UserScript==
// @name         奥鹏教育视频刷课-静音-自动下一课
// @namespace    tantiancai
// @version      0.1
// @description  奥鹏教育视频
// @author       tantiancai
// @match        *://learn.open.com.cn/StudentCenter/CourseWare/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

	setInterval(function () {
		var videos = document.getElementsByTagName('video')

		for (var i = 0; i < videos.length; i++) {
            var current_video = videos[i]
			
            //静音
            current_video.volume = 0
            //16倍速,不被系统认可,因此注释掉。需要开启请删除//
            current_video.playbackRate = 2.0
			if(current_video.paused)
			{
				current_video.play()
			}
        }

		//视频播放结束后,模拟点击“下一课”
        if(document.getElementsByClassName("qrcodebox")[0].style.display == "block"){
			var doc = window.parent.document
			var next_video = doc.getElementsByClassName("progress_btn half_play")
			if(next_video.length > 0)
			{
				next_video[0].previousSibling.click()
			}
			else
			{
				next_video = doc.getElementsByClassName("progress_btn not_play")
				if(next_video.length > 0)
				{
					next_video[0].previousSibling.click()
				}
				else
				{
					// 结束
				}
			}
		}
	}, 2000)
})();