// ==UserScript== // @name chinahrt继续教育加速DrS // @version 0.8 // @description 进入视频自动开始并静音。解除失去焦点自动暂停,后台听不也挺好吗。一般情形可用。注:使用本脚本视频会一直处于播放状态,请关注提示是否已经播完,如弹出课程评价等。 // @author DrS // @license AGPL License // @match *://videoadmin.chinahrt.com*/videoPlay/play* // @match *://web.chinahrt.com*/index.html#/v_video* // @grant none // @namespace https://greasyfork.org/users/849179 // @downloadURL none // ==/UserScript== $(document).ready(function (){ // (function () { // 'use strict'; var speedup=false //----------------函数定义----------------// function goPlayAction(addstr){ addstr = addstr || '默认调用'; try { timer.change(0.333); player.videoPlay(); player.changeVolume(0.1); player.videoMute(); console.log('timehooker加速'); speedup=true; } catch { console.log("没有timehooker,或其他命令失败")} //player.changePlaybackRate(4); //修改播放速度 console.log('播放静音倍速3连【'+addstr+'】'); // setTimeout(function(){player.videoMute();}, 10000); } function pauseAction(addstr,waitTime){ addstr = 'pauseAction'+addstr || 'pauseAction默认调用'; waitTime = waitTime || 1000; if(videoIsEnd==true ){ document.title = '【已播完】'+document.title; } if(document.URL.search('end')>34 ||videoIsEnd==true ){ //window.close(); console.log('检测到视频结束,本次视频恢复取消等待系统进入下一视频'); document.getElementsByClassName('ths')[0].innerText='【本视频已经播放过至少1次】' document.title = '【已播完】'+document.title; $(".f14:first").prepend("【重播】"); waitTime=5000; videoIsEnd=false; }else{setTimeout(function(){goPlayAction(addstr)}, waitTime);} } //时间监听器 function refreshIfMultipleCoursesMessage() { // 使用querySelectorAll来查找所有