1
0
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:
Steve Heffernan 2013-05-02 17:07:05 -07:00
parent 0f115df0b6
commit 4f319a2174
3 changed files with 10 additions and 6 deletions

View File

@ -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_;
};

View File

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

View File

@ -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;