设置视频倍速为2倍,自动播放下一个视频,目前只兼容石油大学 欢迎打赏 [email protected]
当前为
// ==UserScript== // @name 石油大学(华东自动上课脚本) // @namespace http://tampermonkey.net/ // @version 0.6 // @description 设置视频倍速为2倍,自动播放下一个视频,目前只兼容石油大学 欢迎打赏 [email protected] // @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倍速限制改为2倍速. if(videodom.playbackRate!=2){ videodom.playbackRate = 2;} console.log("进了videodom",videodom); if(videodom!=undefined&&videodom!=null){ if(videodom.duration.toFixed() ==videodom.currentTime.toFixed()){ 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("当前已经学完,自动播放下一个"); } } }, 3000); }, 3000); // Your code here... })();