comparison ape.js @ 58:c23050ad945a Dev_main

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 086a10f85fde
children c943465de196
comparison
equal deleted inserted replaced
57:086a10f85fde 58:c23050ad945a
426 var randomise = textXML.attributes['randomiseOrder']; 426 var randomise = textXML.attributes['randomiseOrder'];
427 if (randomise != undefined) {randomise = randomise.value;} 427 if (randomise != undefined) {randomise = randomise.value;}
428 else {randomise = false;} 428 else {randomise = false;}
429 429
430 var audioElements = $(textXML).find('audioElements'); 430 var audioElements = $(textXML).find('audioElements');
431 currentTrackOrder = [];
431 audioElements.each(function(index,element){ 432 audioElements.each(function(index,element){
432 // Find any blind-repeats 433 // Find any blind-repeats
433 // Not implemented yet, but just incase 434 // Not implemented yet, but just incase
434 currentTrackOrder[index] = element; 435 currentTrackOrder[index] = element;
435 }); 436 });
436 if (randomise) { 437 if (randomise) {
437 currentTrackOrder = randomiseOrder(currentTrackOrder); 438 currentTrackOrder = randomiseOrder(currentTrackOrder);
438 } 439 }
440
441 // Delete any previous audioObjects associated with the audioEngine
442 audioEngineContext.audioObjects = [];
439 443
440 // Find all the audioElements from the audioHolder 444 // Find all the audioElements from the audioHolder
441 $(currentTrackOrder).each(function(index,element){ 445 $(currentTrackOrder).each(function(index,element){
442 // Find URL of track 446 // Find URL of track
443 // In this jQuery loop, variable 'this' holds the current audioElement. 447 // In this jQuery loop, variable 'this' holds the current audioElement.