Fix firefox sync, finally!

alternate-visualiser
Will Toohey 10 years ago
parent 009206ce00
commit bf4cfe4da5
  1. 6
      js/SoundManager.js

@ -111,6 +111,8 @@ SoundManager.prototype.playSong = function(song, playBuild, callback) {
if(callback)
callback();
// This fixes sync issues on Firefox and slow machines.
that.context.suspend().then(function() {
if(playBuild) {
// mobile webkit requires offset, even if 0
that.bufSource.start(0);
@ -119,9 +121,9 @@ SoundManager.prototype.playSong = function(song, playBuild, callback) {
that.bufSource.start(0, that.loopStart);
that.startTime = that.context.currentTime;
}
// offset to after the build
//that.startTime = that.context.currentTime + that.loopStart;
that.context.resume();
that.playing = true;
});
}
});
}

Loading…
Cancel
Save