瀏覽代碼

Remote audio load handles errors properly

tags/v0.1.0
Fen Dweller 6 年之前
父節點
當前提交
69a19430e7
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: E80B35A6F11C3656
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. +7
    -1
      audio.js

+ 7
- 1
audio.js 查看文件

@@ -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();
}



Loading…
取消
儲存