This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Track(src, spriteLength, audioLead) { | |
var track = this, | |
audio = document.createElement('audio'); | |
audio.src = src; | |
audio.autobuffer = true; | |
audio.load(); | |
audio.muted = true; // makes no difference on iOS :( | |
/* This is the magic. Since we can't preload, and loading requires a user's | |
input. So we bind a touch event to the body, and fingers crossed, the |