-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Options to hide parts like volume control? #953
Comments
You can go about this a few ways. You could either hide the element using CSS, or disable the component from being drawn in the first place. Either works, but if you potentially want to quickly hide / show an element, you might want to go the CSS route. CSS: .vjs-default-skin .vjs-volume-control { display: none; } During player initialization: var video = videojs('my_video_1', {
children: {
controlBar: {
children: {
volumeControl: false
}
}
}
}); |
Great thanks. The JS solution is definitely better than the CSS one. Don't want to waste memory for something I do not need. Are there other children I can set to |
+1 Documentation is definitely needed for this. I've been searching for all sorts of easier ways to customize and the docs are too sparse on this. |
I can't get this to work. I'm passing a JSON string into the attribute like so:
I know this works because preload and autoplay true/false work. |
Each of those starts with lower case: |
It appears the syntax to disable components via options object has been updated. I'm commenting because this issue seems to rank high in google for a lot of component remove/disable queries. https://github.com/videojs/video.js/blob/master/docs/guides/options.md#component-options Example of new syntax: var player = videojs('video-id', {
controlBar: {
muteToggle: false
}
}); |
The old syntax should still work. Please open a new issue if that's not the case. |
Where is this volumeControl or muteToggle option? Doesn't seem to work at all |
I am having trouble converting the horizontal volume control slider to a vertical slider. What am I doing wrong here? I can transform: rotate but then the slider does not work properly. Thanks. |
I tear all my hair out, so I want to save yours: if you want to hide the volume control or the mute toggle button, you can only hide them together with the |
Hi guys, I want to show liveDisplay always, but by default the control is hidden. |
List of buttons |
|
Am I the only one who finds the API Documentation foggy? |
@mmcc if I follow this method: video.js is great, but it's 24630 lines... I'd very much like to remove the things I don't need, like mute/volume/subtitles/screen reader support/etc. (my videos have no sound). I've tried turning some functions to comment but that somehow breaks everything appart. More doc on what does what would be great. |
@EloFr If you're looking to not have certain control bar components initialize at all, I'd suggest going the route of disabling them in the initializer. |
@mmcc Hi, thanks for the reply. |
@EloFr You're welcome to fork and remove whatever you'd like, but fair warning, we're not going to be able to provide much support after you do so. If you want to completely remove control bar components from the build, you can simply nix the associated import and the component children in the control bar component. |
@mmcc ok, fair enough, I guess I'll leave it be then. Thanks for the replies. |
Is there any nice way to disable / enable controls with JS while the player is already initialized? |
You can use the |
@MrCsabaToth All cases, only you are effective, thank you~ |
JS version for video.js v6.2.4 controlBar: {
volumePanel: false,
} Took a while to find out, none of the options listed here worked, found the right option by trying out converting the volume DOM element class name |
I was looking for the same thing and I just found this in the git file : https://github.com/videojs/video.js/blob/master/docs/guides/components.md#default-component-tree Follow the tree structure and just take care to lowercase the first letter like: It seems to work for most the tree item :) |
how to hide the volume control bar only, on videojs 6.5 i tried
but it doesn't work. |
@ahmadawada11 Did you try jkaipr's solution ? |
jkaipr's solution will hide all the volumecontrol what i want is to leave the mute unmute option and hide the volume bar. |
@ahmadawada11 these options gave me just a mute/unmute button. |
As @lateek35 mentinoed, we try to keep the components doc page up-to-date with the current components. |
ok thank you @tylerwgreen @gkatsev . |
Is there someone around? I've tried something like this: var videoPlayer = document.getElementById('myPlayer');
var user_agent = navigator.userAgent.toLowerCase();
if(user_agent.indexOf('android') > -1) { // Check for Android.
videoPlayer.requestFullscreen();
} But I am getting this error:
Any suggestions? |
Is there a way to remove the download button in CSS? |
The download button is not part of the video.js control bar, it is part of the native chrome controls. If you're using Video.js's control bar you shouldn't have a download button. However, there's a description of how to do it here: #4234 |
Is there a way to disable the progress bar only ? I don't won't my users to keep fast forwarding/back warding. |
Is this the best way to remove the picture-in-picture button for browsers that don't support it?
|
Hello there
I've been looking for options in the API documentation to hide parts of the player, like volume control etc.
Are there any?
The text was updated successfully, but these errors were encountered: