mirror of
https://github.com/videojs/video.js.git
synced 2024-12-12 11:15:04 +02:00
Fix #398
Use a new CSS class 'vjs-disabled' to disable display of the volume controls. This allows custom styles the flexibility to use methods other than `display:block` to layout the controls.
This commit is contained in:
parent
9b25484a92
commit
e55e5a7313
@ -145,6 +145,8 @@ so you can upgrade to newer versions easier. You can remove all these styles by
|
||||
/* Hide control text visually, but have it available for screenreaders: h5bp.com/v */
|
||||
.vjs-default-skin .vjs-control-text { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
|
||||
|
||||
/* Hide disabled or unsupported controls */
|
||||
.vjs-default-skin .vjs-disabled { display: none; }
|
||||
|
||||
/* Play/Pause
|
||||
-------------------------------------------------------------------------------- */
|
||||
|
12
src/js/controls.js
vendored
12
src/js/controls.js
vendored
@ -853,13 +853,13 @@ vjs.VolumeControl = function(player, options){
|
||||
|
||||
// hide volume controls when they're not supported by the current tech
|
||||
if (player.tech && player.tech.features.volumeControl === false) {
|
||||
this.hide();
|
||||
vjs.addClass(this.el(), 'vjs-disabled');
|
||||
}
|
||||
player.on('loadstart', vjs.bind(this, function(){
|
||||
if (player.tech.features.volumeControl === false) {
|
||||
this.hide();
|
||||
vjs.addClass(this.el(), 'vjs-disabled');
|
||||
} else {
|
||||
this.show();
|
||||
vjs.removeClass(this.el(), 'vjs-disabled');
|
||||
}
|
||||
}));
|
||||
};
|
||||
@ -982,13 +982,13 @@ vjs.MuteToggle = function(player, options){
|
||||
|
||||
// hide mute toggle if the current tech doesn't support volume control
|
||||
if (player.tech && player.tech.features.volumeControl === false) {
|
||||
this.hide();
|
||||
vjs.addClass(this.el(), 'vjs-disabled');
|
||||
}
|
||||
player.on('loadstart', vjs.bind(this, function(){
|
||||
if (player.tech.features.volumeControl === false) {
|
||||
this.hide();
|
||||
vjs.addClass(this.el(), 'vjs-disabled');
|
||||
} else {
|
||||
this.show();
|
||||
vjs.removeClass(this.el(), 'vjs-disabled');
|
||||
}
|
||||
}));
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user