播放器拉伸按钮

  抱歉,这篇文章有英文版

To control the width and height of the player container, you need to enable the Settings / Size / Container size. The container must be set width and height (in pixels with css or html).

You also need to add your own button to the control panel and assign it a call to an external JS function that will expand and narrow the player container. Icons of button states in SVG format can be found in the editor's library by separating them with a symbol ///

This function should be available in the global space on the page with the player. Simply it can be like this:

var playerWideMode = false;
function PlayerWideMode(){
    if(playerWideMode){
        document.getElementById("player").style.width = "500px";
    }else{
        document.getElementById("player").style.width = "100%";
    }
    playerWideMode = !playerWideMode;
}

In practice, a wide player usually requires the transformation of other page elements as well. You should also enable the Hide / on fullscreen option in the button settings.

Example:


20.0.5
2024 © PlayerJS

登录

登录

免费注册

注册
注册即表示您同意服务条款
登录(如果您有帐户)

恢复密码

恢复
忘记电子邮件?联系我们