延河课堂播放增强

点击视频空白处切换播放暂停,左右方向键控制5秒快进快退

目前為 2021-11-04 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         延河课堂播放增强
// @namespace    https://www.ordosx.tech/
// @version      1.0
// @description  点击视频空白处切换播放暂停,左右方向键控制5秒快进快退
// @author       OrdosX
// @match        https://www.yanhekt.cn/session/*
// @icon         https://www.google.com/s2/favicons?domain=yanhekt.cn
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.onload = () => {
        main()
    }
    const main = () => {
        if (document.querySelector(".main-player video") == null) {
            setTimeout(main, 20)
        } else {
            document.querySelector(".player-panel").onclick = () => {
                document.querySelector(".controller-panel .head-container button").click()
            }
            document.querySelector(".player-mask").onclick = () => {
                document.querySelector(".controller-panel .head-container button").click()
            }
            document.onkeydown = (e) => {
                switch(e.keyCode){
                    case 37:
                        document.querySelector(".main-player video").currentTime -= 5
                        break
                    case 39:
                        document.querySelector(".main-player video").currentTime += 5
                        break
                }
            }
        }
    }
})();