Mercurial > hg > webaudioevaluationtool
comparison core.js @ 1003:7c047be322c7
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 <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Sat, 30 May 2015 11:19:28 +0100 |
parents | 897b73057397 |
children | d141519a99f2 |
comparison
equal
deleted
inserted
replaced
1002:897b73057397 | 1003:7c047be322c7 |
---|---|
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); |