comparison core.js @ 864:54c1fb5ca218

Feature #1327: Elements start out grey until the audioObject states it is ready. Requires all interfaceDOM nodes to have member enable().
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Thu, 23 Jul 2015 09:51:26 +0100
parents cf593a8bfd71
children d0870902d0a6
comparison
equal deleted inserted replaced
863:2986718bc7b8 864:54c1fb5ca218
907 // Create callback to decode the data asynchronously 907 // Create callback to decode the data asynchronously
908 request.onloadend = function() { 908 request.onloadend = function() {
909 audioContext.decodeAudioData(request.response, function(decodedData) { 909 audioContext.decodeAudioData(request.response, function(decodedData) {
910 audioObj.buffer = decodedData; 910 audioObj.buffer = decodedData;
911 audioObj.state = 1; 911 audioObj.state = 1;
912 if (audioObj.specification.type != 'outsidereference')
913 {audioObj.interfaceDOM.enable();}
912 }, function(){ 914 }, function(){
913 // Should only be called if there was an error, but sometimes gets called continuously 915 // Should only be called if there was an error, but sometimes gets called continuously
914 // Check here if the error is genuine 916 // Check here if the error is genuine
915 if (audioObj.state == 0 || audioObj.buffer == undefined) { 917 if (audioObj.state == 0 || audioObj.buffer == undefined) {
916 // Genuine error 918 // Genuine error