From a7d624affe53ead68bf70bf0bb6eedee34f728da Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Wed, 5 Feb 2014 19:22:43 -0500 Subject: [PATCH] stop immediate propagation on tap events Make media tech controller only hide control bar. --- src/js/component.js | 4 +++- src/js/media/media.js | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/component.js b/src/js/component.js index b1460dd22..4ca4de70c 100644 --- a/src/js/component.js +++ b/src/js/component.js @@ -868,7 +868,9 @@ vjs.Component.prototype.emitTapEvents = function(){ // When the touch ends, measure how long it took and trigger the appropriate // event - this.on('touchend', function() { + this.on('touchend', function(event) { + event.stopImmediatePropagation(); + // Proceed only if the touchmove/leave/cancel event didn't happen if (couldBeTap === true) { // Measure how long the touch lasted diff --git a/src/js/media/media.js b/src/js/media/media.js index 8910a21d6..a51d3b637 100644 --- a/src/js/media/media.js +++ b/src/js/media/media.js @@ -134,7 +134,10 @@ vjs.MediaTechController.prototype.onClick = function(event){ */ vjs.MediaTechController.prototype.onTap = function(){ - this.player().userActive(!this.player().userActive()); + var userActivity = this.player().userActive(); + if (userActivity) { + this.player().userActive(!userActivity); + } }; vjs.MediaTechController.prototype.features = {