diff --git a/src/js/control-bar/mute-toggle.js b/src/js/control-bar/mute-toggle.js index aafedcaec..8a1f96d7d 100644 --- a/src/js/control-bar/mute-toggle.js +++ b/src/js/control-bar/mute-toggle.js @@ -12,11 +12,11 @@ vjs.MuteToggle = vjs.Button.extend({ player.on('volumechange', vjs.bind(this, this.update)); // hide mute toggle if the current tech doesn't support volume control - if (player.tech && player.tech.features && player.tech.features.volumeControl === false) { + if (player.tech && player.tech.features && player.tech.features['volumeControl'] === false) { this.addClass('vjs-hidden'); } player.on('loadstart', vjs.bind(this, function(){ - if (player.tech.features && player.tech.features.volumeControl === false) { + if (player.tech.features && player.tech.features['volumeControl'] === false) { this.addClass('vjs-hidden'); } else { this.removeClass('vjs-hidden'); @@ -66,4 +66,4 @@ vjs.MuteToggle.prototype.update = function(){ vjs.removeClass(this.el_, 'vjs-vol-'+i); } vjs.addClass(this.el_, 'vjs-vol-'+level); -}; \ No newline at end of file +}; diff --git a/src/js/control-bar/volume-control.js b/src/js/control-bar/volume-control.js index 86bc5b617..db7b9ebd9 100644 --- a/src/js/control-bar/volume-control.js +++ b/src/js/control-bar/volume-control.js @@ -10,11 +10,11 @@ vjs.VolumeControl = vjs.Component.extend({ vjs.Component.call(this, player, options); // hide volume controls when they're not supported by the current tech - if (player.tech && player.tech.features && player.tech.features.volumeControl === false) { + if (player.tech && player.tech.features && player.tech.features['volumeControl'] === false) { this.addClass('vjs-hidden'); } player.on('loadstart', vjs.bind(this, function(){ - if (player.tech.features && player.tech.features.volumeControl === false) { + if (player.tech.features && player.tech.features['volumeControl'] === false) { this.addClass('vjs-hidden'); } else { this.removeClass('vjs-hidden'); @@ -131,4 +131,4 @@ vjs.VolumeLevel.prototype.createEl = function(){ return vjs.SliderHandle.prototype.createEl.call(this, 'div', { className: 'vjs-volume-handle' }); - }; \ No newline at end of file + }; diff --git a/src/js/media/html5.js b/src/js/media/html5.js index b12870281..c9bff000c 100644 --- a/src/js/media/html5.js +++ b/src/js/media/html5.js @@ -13,13 +13,13 @@ vjs.Html5 = vjs.MediaTechController.extend({ /** @constructor */ init: function(player, options, ready){ // volume cannot be changed from 1 on iOS - this.features.volumeControl = vjs.Html5.canControlVolume(); + this.features['volumeControl'] = vjs.Html5.canControlVolume(); // In iOS, if you move a video element in the DOM, it breaks video playback. - this.features.movingMediaElementInDOM = !vjs.IS_IOS; + this.features['movingMediaElementInDOM'] = !vjs.IS_IOS; // HTML video is able to automatically resize when going to fullscreen - this.features.fullscreenResize = true; + this.features['fullscreenResize'] = true; vjs.MediaTechController.call(this, player, options, ready); @@ -72,7 +72,7 @@ vjs.Html5.prototype.createEl = function(){ // Check if this browser supports moving the element into the box. // On the iPhone video will break if you move the element, // So we have to create a brand new element. - if (!el || this.features.movingMediaElementInDOM === false) { + if (!el || this.features['movingMediaElementInDOM'] === false) { // If the original tag is still there, remove it. if (el) { diff --git a/src/js/media/media.js b/src/js/media/media.js index 371576952..7565abc3d 100644 --- a/src/js/media/media.js +++ b/src/js/media/media.js @@ -154,15 +154,15 @@ vjs.MediaTechController.prototype.onTap = function(){ }; vjs.MediaTechController.prototype.features = { - volumeControl: true, + 'volumeControl': true, // Resizing plugins using request fullscreen reloads the plugin - fullscreenResize: false, + 'fullscreenResize': false, // Optional events that we can manually mimic with timers // currently not triggered by video-js-swf - progressEvents: false, - timeupdateEvents: false + 'progressEvents': false, + 'timeupdateEvents': false }; vjs.media = {}; diff --git a/src/js/player.js b/src/js/player.js index 9f9c0e371..1799f5b57 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -235,12 +235,12 @@ vjs.Player.prototype.loadTech = function(techName, source){ this.player_.triggerReady(); // Manually track progress in cases where the browser/flash player doesn't report it. - if (!this.features.progressEvents) { + if (!this.features['progressEvents']) { this.player_.manualProgressOn(); } // Manually track timeudpates in cases where the browser/flash player doesn't report it. - if (!this.features.timeupdateEvents) { + if (!this.features['timeupdateEvents']) { this.player_.manualTimeUpdatesOn(); } }; @@ -305,7 +305,7 @@ vjs.Player.prototype.manualProgressOn = function(){ this.tech.one('progress', function(){ // Update known progress support for this playback technology - this.features.progressEvents = true; + this.features['progressEvents'] = true; // Turn off manual progress tracking this.player_.manualProgressOff(); @@ -344,7 +344,7 @@ vjs.Player.prototype.manualTimeUpdatesOn = function(){ // Watch for native timeupdate event this.tech.one('timeupdate', function(){ // Update known progress support for this playback technology - this.features.timeupdateEvents = true; + this.features['timeupdateEvents'] = true; // Turn off manual progress tracking this.player_.manualTimeUpdatesOff(); }); diff --git a/test/unit/controls.js b/test/unit/controls.js index e34e81044..30cdd95c2 100644 --- a/test/unit/controls.js +++ b/test/unit/controls.js @@ -11,7 +11,7 @@ test('should hide volume control if it\'s not supported', function(){ ready: noop, tech: { features: { - volumeControl: false + 'volumeControl': false } }, volume: function(){}, @@ -43,7 +43,7 @@ test('should test and toggle volume control on `loadstart`', function(){ }, tech: { features: { - volumeControl: true + 'volumeControl': true } } }; @@ -56,7 +56,7 @@ test('should test and toggle volume control on `loadstart`', function(){ ok(muteToggle.el().className.indexOf('vjs-hidden') < 0, 'muteToggle is hidden initially'); - player.tech.features.volumeControl = false; + player.tech.features['volumeControl'] = false; for (i = 0; i < listeners.length; i++) { listeners[i](); } @@ -66,7 +66,7 @@ test('should test and toggle volume control on `loadstart`', function(){ ok(muteToggle.el().className.indexOf('vjs-hidden') >= 0, 'muteToggle does not hide itself'); - player.tech.features.volumeControl = true; + player.tech.features['volumeControl'] = true; for (i = 0; i < listeners.length; i++) { listeners[i](); }