设置视频倍速为2-8倍随机,自动播放下一个视频,目前只兼容石油大学 欢迎打赏,体验更完善版本
当前为
// ==UserScript==
// @name 中石油大学,继续教育、函授、华东石油大学、在线网课、刷课、自动、上课脚本。
// @namespace http://tampermonkey.net/
// @version 0.8
// @description 设置视频倍速为2-8倍随机,自动播放下一个视频,目前只兼容石油大学 欢迎打赏,体验更完善版本
// @author 智慧
// @match *://cj1047-kfkc.webtrn.cn/*
// @icon https://www.google.com/s2/favicons?domain=webtrn.cn
// @grant none
// ==/UserScript==
(function () {
'use strict';
setTimeout(function () {
setInterval(function () {
if ($(".layui-layer-btn0")[0] != undefined) {
$(".layui-layer-btn0").click()
$(".contentIframe").contents().find("iframe").contents().find("video")[0].play();
}
let doc = $(".contentIframe").contents();
let videodom = doc.find("iframe").contents().find("video")[0]
//设置视频突破2倍速限制改为16倍速.
//if(videodom.playbackRate!=10){ videodom.playbackRate = 10;}
if (videodom != undefined && videodom != null) {
console.log("进了videodom", videodom.playbackRate);
if (videodom.duration.toFixed(1) == videodom.currentTime.toFixed(1)) {
let items = doc.find('li[id^=childItem_]');
console.log("进了items", items)
let curr = $(items[items.index(doc.find('.select'))]);
let next = $(items[items.index(doc.find('.select')) + 1]);
console.log("进了next", next);
next.addClass("select");
curr.removeClass("select");
next.children('a').click()
console.log("当前已经学完,自动播放下一个");
}
if (videodom.duration <= 200 || videodom.playbackRate >= 8) {
if (videodom.playbackRate != 1.5) { videodom.playbackRate = 1.5; }
}
else if ((videodom.duration - videodom.currentTime) < 400 || videodom.duration <= 400) {
if (videodom.playbackRate != 2) { videodom.playbackRate = 2; }
}
else {
if (videodom.playbackRate <= 8) { videodom.playbackRate = videodom.playbackRate + 1; }
}
}
}, 3000);
}, 3500);
// Your code here...
})();