diff --git a/src/js/component.js b/src/js/component.js index 939c06ea1..eb7aaea28 100644 --- a/src/js/component.js +++ b/src/js/component.js @@ -66,7 +66,9 @@ vjs.Component = vjs.CoreObject.extend({ // Don't want to trigger ready here or it will before init is actually // finished for all children that run this constructor - this.enableUserActivity(); + if (options.reportUserActivity) { + this.enableUserActivity(); + } } }); diff --git a/src/js/media/media.js b/src/js/media/media.js index b446b1cf4..792d8f4c4 100644 --- a/src/js/media/media.js +++ b/src/js/media/media.js @@ -12,10 +12,12 @@ vjs.MediaTechController = vjs.Component.extend({ /** @constructor */ init: function(player, options, ready){ + // we don't want the tech to report user activity automatically. + // This is done manually in addControlsListeners + options.reportUserActivity = false; vjs.Component.call(this, player, options, ready); this.initControlsListeners(); - this.disableUserActivity(); } }); diff --git a/src/js/player.js b/src/js/player.js index f12158400..232514a79 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -54,6 +54,9 @@ vjs.Player = vjs.Component.extend({ // May be turned back on by HTML5 tech if nativeControlsForTouch is true tag.controls = false; + // we don't want the player to report user activity + options.reportUserActivity = false; + // Run base component initializing with new options. // Builds the element through createEl() // Inits and embeds any child components in opts @@ -106,7 +109,6 @@ vjs.Player = vjs.Component.extend({ } this.listenForUserActivity(); - this.disableUserActivity(); } }); diff --git a/test/unit/component.js b/test/unit/component.js index c3cad1d27..4bb2abfe4 100644 --- a/test/unit/component.js +++ b/test/unit/component.js @@ -229,9 +229,7 @@ test('should emit a tap event', function(){ var origTouch = vjs.TOUCH_ENABLED; vjs.TOUCH_ENABLED = true; - var comp = new vjs.Component(getFakePlayer(), {}); - - comp.disableUserActivity(); + var comp = new vjs.Component(getFakePlayer(), {reportUserActivity: false}); comp.emitTapEvents(); comp.on('tap', function(){