1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-12 11:15:04 +02:00
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:
David LaPalomento 2013-03-24 17:40:35 -04:00
parent 9b25484a92
commit e55e5a7313
2 changed files with 8 additions and 6 deletions

View File

@ -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
View File

@ -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');
}
}));
};