您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
厦门市职业技能培训总站自动播放下一个视频
当前为
// ==UserScript== // @name 职业培训自动播放 // @namespace http://tampermonkey.net/ // @version 0.2 // @description 厦门市职业技能培训总站自动播放下一个视频 // @author mouc // @include /http?:\/\/xmaqsc\.zyk\.yxlearning\.com\/learning/.* // @require https://code.jquery.com/jquery-3.3.1.min.js // @run-at document-idle // @license MIT License // @grant none // ==/UserScript== (function() { 'use strict'; const delay = 10000;//重试间隔 let play = ()=>{ $('.polyvFlashObject')[0].j2s_resumeVideo(); }; var interval = null;//计时器 function start(){ if (interval != null){ clearInterval(interval); interval = null; } //每隔delay毫秒恢复播放 interval = setInterval(() => { if( $('.polyvFlashObject').length === 1 ){ //console.warn("检测到播放器, 正在重试恢复播放...") if ($($($(".beginstyle")[1])[0]).children()[1].innerText < 100){ play(); } else { console.warn("检测到总进度为100, 停止播放于"+ (new Date).toString()); stop(); } }else{ console.error("没有检测到播放器, " + delay + "毫秒后重试..."); } }, delay); } start(); function stop(){ $('.polyvFlashObject')[0].j2s_stopVideo(); clearInterval(interval); interval = null; } // Your code here... })();