您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
河南专技在线脚本
当前为
// ==UserScript== // @name 河南专技在线辅助 // @version 0.1 // @description 河南专技在线脚本 // @author huangdi // @match *://*.ghlearning.com/* // @require http://code.jquery.com/jquery-1.12.4.min.js // @namespace http://greasyfork.icu/users/360494 // ==/UserScript== (function() { //'use strict'; // Your code here... // For more, refer to http://dev.polyv.net/2013/videoproduct/v-playerapi/v-playerapi-event/jsbf0001/ function resume() { player.j2s_resumeVideo(); } function pause() { player.j2s_pauseVideo(); } function seek(sec) { player.j2s_seekVideo(sec); } function stop() { player.j2s_stopVideo(); } function vol(v) { player.j2s_setVolume(v); } function nextVideo(vid) { player.changeVid(vid); } function toNext(){ setTimeout(function(){ var text=$('li[id][class=active]')[0].innerText; console.log(text.match(/[0-9]+%/)[0]); if(text.match(/[0-9]+%/)[0]=="100%"){ seek(player.j2s_getDuration()-1); resume(); console.log(text+'播放结束,即将播放下一个视频'); }else if(text.match(/[0-9]+%/)[0]=="50%"){ location.reload();//每个视频刷新一次页面,避免页面死掉。 }else{ setTimeout(arguments.callee, 5000); }}, 5000); } function pauseFuc (){ window.s2j_onVideoPause = function () { console.log('修改暂停函数,暂停时继续计时ing...'); } } function start(){ console.log('播放器初始化完成'); player=document.getElementsByClassName("polyvFlashObject")[0]; setTimeout(resume,3000); setTimeout(function (){vol(0);},3500); setTimeout(pauseFuc,4000); setTimeout(pause,5000); setTimeout(toNext,6000); } var player; window.s2j_onPlayerInitOver=start; })();