# HG changeset patch # User Nicholas Jillings # Date 1456156108 0 # Node ID 0e49d874ba979d979b270c1cb0de1243935d6c53 # Parent 96acb21e1cd58e34df6de7f4dee9c4bd18e41b25 Interfaces report error if audio cannot be loaded/decoded/played diff -r 96acb21e1cd5 -r 0e49d874ba97 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 96acb21e1cd5 -r 0e49d874ba97 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