Greasy Fork

Greasy Fork is available in English.

chinahrt继续教育加速DrS

进入视频自动开始并静音。移除自动暂停。一般情形可用。

当前为 2022-05-09 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         chinahrt继续教育加速DrS

// @version      0.5
// @description  进入视频自动开始并静音。移除自动暂停。一般情形可用。
// @author       DrS
// @match        *://videoadmin.chinahrt.com*/videoPlay/play*
// @match        *://web.chinahrt.com*/index.html#/v_video*
// @grant        none
// @namespace http://greasyfork.icu/users/849179
// ==/UserScript==
$(document).ready(function (){
    // (function () {
    // 'use strict';
//----------------函数定义----------------//
    function goPlayAction(addstr){
        addstr = addstr || '默认调用';
        player.videoPlay();
            player.videoMute();
            player.changePlaybackRate(4); //修改播放速度
            console.log('播放静音倍速3连【'+addstr+'】');

    }
        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;
                    waitTime=5000;
                    videoIsEnd=false;
                }else{setTimeout(function(){goPlayAction(addstr)}, waitTime);}

        }
//----------------函数定义end----------------//
    window.onfocus = function () { console.log('onfocus焦点监控事件已被替换') };
    window.onblur = function () { console.log('onblur原始事件已被替换') };
    var videoIsEnd =false;

    var tmp = setInterval(function () {
        if (player) {
            player.addListener('loadedmetadata', function () {
                setTimeout(function(){goPlayAction('初始加载')}, 1000);
                clearInterval(tmp);
            });
           //player.addListener('pause',pauseAction('暂停监听'));
           player.addListener('ended',function(){videoIsEnd=true});
        }
    }, 500);
setInterval(function () {
    var playerMetaDate=player.getMetaDate();
    if(playerMetaDate['paused']){
        pauseAction('循环检测发现暂停');
        };

} ,20000);
});