Update Pixi.
Fix some things so that if errors happen in audio the rest will still run.
This commit is contained in:
parent
9f1efa1225
commit
447eb0b3dd
4 changed files with 30 additions and 21 deletions
10
Js/Audio.js
10
Js/Audio.js
|
@ -3,6 +3,7 @@
|
|||
|
||||
class bufferLoader {
|
||||
constructor(context, soundMap, callback) {
|
||||
debugger;
|
||||
this.context = context;
|
||||
this.soundMap = soundMap;
|
||||
this.onloadUpdate = callback;
|
||||
|
@ -41,7 +42,8 @@ class bufferLoader {
|
|||
}
|
||||
resolve(`${this.loadCount}|${this.soundMap.length}`);
|
||||
},
|
||||
function(error) {
|
||||
(error) => {
|
||||
|
||||
console.log(error);
|
||||
console.log(`url: ${url}, name: ${name}`);
|
||||
if(this.onloadUpdate) {
|
||||
|
@ -52,10 +54,16 @@ class bufferLoader {
|
|||
);
|
||||
});
|
||||
}, (failure) => {
|
||||
if(this.onloadUpdate) {
|
||||
this.onloadUpdate((++this.loadCount / this.soundMap.length) * 100);
|
||||
}
|
||||
console.log(failure);
|
||||
reject(failure);
|
||||
});
|
||||
} catch(error) {
|
||||
if(this.onloadUpdate) {
|
||||
this.onloadUpdate((++this.loadCount / this.soundMap.length) * 100);
|
||||
}
|
||||
console.log(error);
|
||||
reject(error);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue