// ==UserScript== // @name Plyr Video Controller Pro (可安装版) // @namespace http://tampermonkey.net/ // @version 1.5 // @description 带浮动控制面板的Plyr视频控制器(播放时触发跳转+自动点击确认) // @author glenn // @match http://dxzx.ouc.edu.cn/* // @grant GM_addStyle // @grant GM_getValue // @grant GM_setValue // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js // @license MIT // @run-at document-end // @downloadURL https://update.greasyfork.icu/scripts/535951/Plyr%20Video%20Controller%20Pro%20%28%E5%8F%AF%E5%AE%89%E8%A3%85%E7%89%88%29.user.js // @updateURL https://update.greasyfork.icu/scripts/535951/Plyr%20Video%20Controller%20Pro%20%28%E5%8F%AF%E5%AE%89%E8%A3%85%E7%89%88%29.meta.js // ==/UserScript== (function() { 'use strict'; // 配置存储 const config = { autoSkip: GM_getValue('autoSkip', true), enableSeek: GM_getValue('enableSeek', true), playbackSpeed: GM_getValue('speed', 2.0), skipDelay: GM_getValue('delay', 100), autoClick: GM_getValue('autoClick', true), debugMode: GM_getValue('debug', true) }; // 精准样式(匹配目标网站UI) GM_addStyle(` #plyr-control-panel { position: fixed; bottom: 20px; right: 20px; z-index: 9999; background: rgba(255,255,255,0.95); border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px 15px; width: 260px; box-shadow: 0 3px 12px rgba(0,0,0,0.15); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; } #plyr-control-panel h3 { margin: 0 0 10px 0; color: #333; font-size: 16px; font-weight: 600; border-bottom: 1px solid #eee; padding-bottom: 8px; } .control-row { margin: 12px 0; display: flex; align-items: center; } .control-label { flex: 1; font-size: 14px; color: #555; } .control-btn { background: #f8f9fa; border: 1px solid #dadce0; color: #3c4043; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; transition: all 0.2s; } .control-btn:hover { background: #f1f3f4; border-color: #d2e3fc; } .control-checkbox { margin-right: 8px; accent-color: #1a73e8; } .speed-input { width: 50px; padding: 4px; border: 1px solid #dadce0; border-radius: 4px; text-align: center; } `); // 自动点击"我知道了"(精准匹配图片结构) function autoClickConfirm() { if (!config.autoClick) return false; // 精确匹配路径:.public_cont1 > .public_table > .public_text > a.public_result const confirmButton = document.querySelector('.public_cont1 .public_table .public_text a.public_result'); if (confirmButton && confirmButton.textContent.trim() === "我知道了") { confirmButton.click(); debugLog('自动点击成功'); return true; } return false; } // 创建控制面板(中文化界面) function createControlPanel() { const panel = document.createElement('div'); panel.id = 'plyr-control-panel'; panel.innerHTML = `