问题
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