uyx-pro

将播放器替换为更强大的DPlayer,以支持弹幕、键盘控制和下载功能

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         uyx-pro
// @namespace    krytro.com
// @version      0.1
// @description  将播放器替换为更强大的DPlayer,以支持弹幕、键盘控制和下载功能
// @author       NitroFire
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/DPlayer.min.js
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// @include      https://apppc.uyxedu.com/*
// @license MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict'
    var dp = null
    setInterval(() => {
        if (!document.location.href.match('https://apppc.uyxedu.com/uycourse/detail')) {
            dp && dp.destroy()
            dp = null
            return
        }
        var video = $('.video-js video')
        if (video.length !== 0 && video.attr('src')) {
            var src = video.attr('src')
            $('.video-js').remove()
            dp = new DPlayer({
                container: $('.video-wrap')[0],
                screenshot: true,
                video: {
                    url: src,
                },
                playbackSpeed: [0.5, 0.75, 1, 1.25, 1.5, 2, 3],
                danmaku: {
                    id: 'uxy-pro-' + src.match(/[0-9a-f\-]{10,100}/)[0],
                    api: 'https://api.krytro.com:1443/dplayer/',
                },
                contextmenu: [
                    {
                        text: '原视频',
                        link: src,
                    }
                ]
            })
        }
    }, 100)
})();