changeset 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 c2b433c675c0
files ape.js core.js
diffstat 2 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ape.js	Sat May 30 10:51:55 2015 +0100
+++ b/ape.js	Sat May 30 11:19:28 2015 +0100
@@ -374,7 +374,6 @@
 			if (this.status == 1) {
 				this.audioObjects[id].outputGain.gain.value = 1.0;
 				this.audioObjects[id].play(audioContext.currentTime+0.01);
-                this.audioObjects[id].flagAsPlayed(); 
 			}
 		};
 	}
--- a/core.js	Sat May 30 10:51:55 2015 +0100
+++ b/core.js	Sat May 30 11:19:28 2015 +0100
@@ -547,7 +547,7 @@
 		this.bufferNode.loop = audioEngineContext.loopPlayback;
 		this.bufferNode.onended = function() {
 			// Safari does not like using 'this' to reference the calling object!
-			this.owner.metric.stopListening(audioEngineContext.timer.getTestTime());
+			event.srcElement.owner.metric.stopListening(audioEngineContext.timer.getTestTime());
 		};
 		if (this.bufferNode.loop == false) {
 			this.metric.startListening(audioEngineContext.timer.getTestTime());