How to remove volume control on on player?

心不动则不痛 提交于 2021-01-06 03:29:53

问题


I would like to remove volume control on videojs player. Anyway, when the user click on fullscreen, thevolume control must appear again. So I want to remove volume control only when the player is not on fullscreen. Is it possible in videojs?


回答1:


video.js uses styles for states such as fullscreen, so you can control this with CSS:

.video-js .vjs-volume-menu-button {
  display:none;
}
.video-js.vjs-fullscreen .vjs-volume-menu-button {
  display:block;
}



回答2:


const videoplayer = videojs('video-player', {
            controlBar: {
                'pictureInPictureToggle': false,
                'volumePanel': false,
            }
        });


来源:https://stackoverflow.com/questions/35106957/how-to-remove-volume-control-on-on-player

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!