comparison core.js @ 1742:d23c39d5625a

Bug #1256 Fix: Safari does not use 'this' on the buffer.onended to reference to the buffer, but to the Window. Now uses event. Tested on chrome OSX as well.
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Sat, 30 May 2015 11:19:28 +0100
parents bbab0bf29e5c
children d141519a99f2
comparison
equal deleted inserted replaced
1741:bbab0bf29e5c 1742:d23c39d5625a
545 this.bufferNode.connect(this.outputGain); 545 this.bufferNode.connect(this.outputGain);
546 this.bufferNode.buffer = this.buffer; 546 this.bufferNode.buffer = this.buffer;
547 this.bufferNode.loop = audioEngineContext.loopPlayback; 547 this.bufferNode.loop = audioEngineContext.loopPlayback;
548 this.bufferNode.onended = function() { 548 this.bufferNode.onended = function() {
549 // Safari does not like using 'this' to reference the calling object! 549 // Safari does not like using 'this' to reference the calling object!
550 this.owner.metric.stopListening(audioEngineContext.timer.getTestTime()); 550 event.srcElement.owner.metric.stopListening(audioEngineContext.timer.getTestTime());
551 }; 551 };
552 if (this.bufferNode.loop == false) { 552 if (this.bufferNode.loop == false) {
553 this.metric.startListening(audioEngineContext.timer.getTestTime()); 553 this.metric.startListening(audioEngineContext.timer.getTestTime());
554 } 554 }
555 this.bufferNode.start(startTime); 555 this.bufferNode.start(startTime);