mirror of
https://github.com/videojs/video.js.git
synced 2024-12-27 02:43:45 +02:00
Fixed muted errors in tests from previous pull request. Removed error captureing that was preventing test breakage.
This commit is contained in:
parent
0f115df0b6
commit
4f319a2174
@ -427,6 +427,7 @@ vjs.Player.prototype.techCall = function(method, arg){
|
||||
this.tech[method](arg);
|
||||
} catch(e) {
|
||||
vjs.log(e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -447,22 +448,19 @@ vjs.Player.prototype.techGet = function(method){
|
||||
try {
|
||||
return this.tech[method]();
|
||||
} catch(e) {
|
||||
|
||||
// When building additional tech libs, an expected method may not be defined yet
|
||||
if (this.tech[method] === undefined) {
|
||||
vjs.log('Video.js: ' + method + ' method not defined for '+this.techName+' playback technology.', e);
|
||||
|
||||
} else {
|
||||
|
||||
// When a method isn't available on the object it throws a TypeError
|
||||
if (e.name == 'TypeError') {
|
||||
vjs.log('Video.js: ' + method + ' unavailable on '+this.techName+' playback technology element.', e);
|
||||
this.tech.isReady_ = false;
|
||||
throw e;
|
||||
} else {
|
||||
vjs.log(e);
|
||||
}
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@ -877,7 +875,11 @@ vjs.Player.prototype.controls_;
|
||||
*/
|
||||
vjs.Player.prototype.controls = function(controls){
|
||||
if (controls !== undefined) {
|
||||
this.controls_ = controls;
|
||||
// Don't trigger a change event unless it actually changed
|
||||
if (this.controls_ !== controls) {
|
||||
this.controls_ = !!controls; // force boolean
|
||||
this.trigger('controlschange');
|
||||
}
|
||||
}
|
||||
return this.controls_;
|
||||
};
|
||||
|
3
test/unit/controls.js
vendored
3
test/unit/controls.js
vendored
@ -14,7 +14,8 @@ test('should hide volume control if it\'s not supported', function(){
|
||||
volumeControl: false
|
||||
}
|
||||
},
|
||||
volume: function(){}
|
||||
volume: function(){},
|
||||
muted: function(){}
|
||||
};
|
||||
|
||||
volumeControl = new vjs.VolumeControl(player);
|
||||
|
@ -32,6 +32,7 @@ vjs.MediaFaker.prototype.createEl = function(){
|
||||
|
||||
vjs.MediaFaker.prototype.currentTime = function(){ return 0; };
|
||||
vjs.MediaFaker.prototype.volume = function(){ return 0; };
|
||||
vjs.MediaFaker.prototype.muted = function(){ return false; };
|
||||
|
||||
// Export vars for Closure Compiler
|
||||
vjs['MediaFaker'] = vjs.MediaFaker;
|
||||
|
Loading…
Reference in New Issue
Block a user