mirror of
https://github.com/videojs/video.js.git
synced 2024-12-27 02:43:45 +02:00
Don't enable enableUserActivity on an option
This commit is contained in:
parent
75a23135e6
commit
9975ed407a
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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(){
|
||||
|
Loading…
Reference in New Issue
Block a user