Przeglądaj źródła

Remote audio load handles errors properly

tags/v0.1.0
Fen Dweller 6 lat temu
rodzic
commit
69a19430e7
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: E80B35A6F11C3656
1 zmienionych plików z 7 dodań i 1 usunięć
  1. +7
    -1
      audio.js

+ 7
- 1
audio.js Wyświetl plik

@@ -60,7 +60,13 @@ function loadRemoteAudio(name) {

xhr.open("GET", audioBaseUrl + name, true);
xhr.responseType = "arraybuffer";
xhr.onload = (xhr) => cacheAndParse(name, xhr.data);
xhr.onload = (xhr) => {
if (xhr.status == 200)
cacheAndParse(name, xhr.data);
else
console.log("Couldn't load " + name);
}
xhr.onerror = (xhr) => console.log("Couldn't load " + name);
xhr.send();
}



Ładowanie…
Anuluj
Zapisz