Maximize Video

Maximize all video players.Support Piture-in-picture.

< 腳本Maximize Video的回應

評論:正評 - 腳本一切正常

§
發表於:2023-03-29

Hello, I think this script is 20/10, but I'd love you to add an option for us to use our own keybind(s). Something similar to what I have below.


Add this to the top of the script (the keybind is escape):

(function() {
    'use strict';

    var KEYCODE_ESCAPE = 27;
    var button = document.getElementById('playerControlBtn');
    var clicked = false;

    document.addEventListener('keydown', function(e) {
        if (e.keyCode === KEYCODE_ESCAPE) {
            if (clicked) {
                button.classList.remove('clicked');
                clicked = false;
            } else {
                button.classList.add('clicked');
                clicked = true;
                button.click();
            }
        }
    });
})();

Once you've added the code above, press ctrl+f and find this:

'#playerControlBtn {text-shadow: none;visibility:hidden;opacity:0;display:none;transition: all 0.5s ease;cursor: pointer;font: 12px "微软雅黑";margin:0;width:64px;height:20px;line-height:20px;border:none;text-align: center;position: fixed;z-index:2147483647;background-color: #27A9D8;color: #FFF;}

Once you've found it, change “hidden” to “visible” for visibility.

發表回覆

登入以回復