Skip to content

Instantly share code, notes, and snippets.

@gkatsev
Created February 4, 2014 20:42
Show Gist options
  • Save gkatsev/8811933 to your computer and use it in GitHub Desktop.
Save gkatsev/8811933 to your computer and use it in GitHub Desktop.
function readTep(evt) {
var three;
taps.push((new Date()).getTime());
taps = taps.slice(-3);
if (taps.length === 3) {
three = taps.reduce(function(p, c, i) {
return p && Math.abs(c - (taps[i - 1] || c)) < 50;
}, true);
if (three) {
callback();
taps.length = 0;
}
}
}
player.on('tap', readTap);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment