Skip to content

Commit

Permalink
@mister-ben fixed android treating swipe as a tap. closes videojs#3514
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGELOG.md
  • Loading branch information
mister-ben authored and akashta committed Apr 13, 2017
1 parent 71ea459 commit d725fc9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/js/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import * as Guid from './utils/guid.js';
import * as Events from './utils/events.js';
import log from './utils/log.js';
import toTitleCase from './utils/to-title-case.js';
import assign from 'object.assign';
import mergeOptions from './utils/merge-options.js';


Expand Down Expand Up @@ -1176,8 +1175,11 @@ class Component {
this.on('touchstart', function(event) {
// If more than one finger, don't consider treating this as a click
if (event.touches.length === 1) {
// Copy the touches object to prevent modifying the original
firstTouch = assign({}, event.touches[0]);
// Copy pageX/pageY from the object
firstTouch = {
pageX: event.touches[0].pageX,
pageY: event.touches[0].pageY
};
// Record start time so we can detect a tap vs. "touch and hold"
touchStart = new Date().getTime();
// Reset couldBeTap tracking
Expand Down

0 comments on commit d725fc9

Please sign in to comment.