# HG changeset patch # User Nicholas Jillings # Date 1456156108 0 # Node ID 43a4dbca4471088c8ddce3598226cc1d03adf0e5 # Parent 320c8b0458fe2444cb8ba042fa0073d2f1376b8d Interfaces report error if audio cannot be loaded/decoded/played diff -r 320c8b0458fe -r 43a4dbca4471 core.css --- a/core.css Mon Feb 22 15:05:39 2016 +0000 +++ b/core.css Mon Feb 22 15:48:28 2016 +0000 @@ -151,4 +151,12 @@ height: 25px; margin-left: 5px; float: left; +} + +div.error-colour { + background-color: #FF8F8F; +} +button.error-colour { + background-color: #FF8F8F; + color: black; } \ No newline at end of file diff -r 320c8b0458fe -r 43a4dbca4471 core.js --- a/core.js Mon Feb 22 15:05:39 2016 +0000 +++ b/core.js Mon Feb 22 15:48:28 2016 +0000 @@ -982,6 +982,7 @@ // Create callback to decode the data asynchronously this.xmlRequest.onloadend = function() { // Use inbuilt WAVE decoder first + if (this.status == -1) {return;} var waveObj = new WAVE(); if (waveObj.open(bufferObj.xmlRequest.response) == 0) { @@ -1011,7 +1012,7 @@ console.log('URL: '+audioObj.url); errorSessionDump('Fragment '+audioObj.id+' 404 error'); } - this.status = -1; + this.parent.status = -1; } }); } @@ -1021,6 +1022,20 @@ calculateLoudness(bufferObj,"I"); } }; + + // Create callback for any error in loading + this.xmlRequest.onerror = function() { + this.parent.status = -1; + for (var i=0; i