diff ape.js @ 682:820805ac7326

Bug fix: Randomisation causes system not to load new audio elements when progressing through pages
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Mon, 20 Apr 2015 18:50:06 +0100
parents ab56aa2fe064
children f602b19b20fd
line wrap: on
line diff
--- a/ape.js	Sat Apr 18 15:36:10 2015 +0100
+++ b/ape.js	Mon Apr 20 18:50:06 2015 +0100
@@ -428,6 +428,7 @@
 	else {randomise = false;}
 	
 	var audioElements = $(textXML).find('audioElements');
+	currentTrackOrder = [];
 	audioElements.each(function(index,element){
 		// Find any blind-repeats
 		// Not implemented yet, but just incase
@@ -437,6 +438,9 @@
 		currentTrackOrder = randomiseOrder(currentTrackOrder);
 	}
 	
+	// Delete any previous audioObjects associated with the audioEngine
+	audioEngineContext.audioObjects = [];
+	
 	// Find all the audioElements from the audioHolder
 	$(currentTrackOrder).each(function(index,element){
 		// Find URL of track