diff --git a/src/js/player.js b/src/js/player.js index 436cf47c1..332e29421 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -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_; }; diff --git a/test/unit/controls.js b/test/unit/controls.js index 5b58fa738..e34e81044 100644 --- a/test/unit/controls.js +++ b/test/unit/controls.js @@ -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); diff --git a/test/unit/mediafaker.js b/test/unit/mediafaker.js index 1630a420f..29c29c4c1 100644 --- a/test/unit/mediafaker.js +++ b/test/unit/mediafaker.js @@ -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;