From 447eb0b3dd2169ee738c81d3d04a024cd440449f Mon Sep 17 00:00:00 2001 From: firebingo Date: Fri, 11 May 2018 09:37:03 -0700 Subject: [PATCH] Update Pixi. Fix some things so that if errors happen in audio the rest will still run. --- Js/Audio.js | 10 +++++++++- Js/Main.js | 4 ++-- Js/Pixi.min.js | 31 ++++++++++++++++--------------- Player.html | 6 +++--- 4 files changed, 30 insertions(+), 21 deletions(-) diff --git a/Js/Audio.js b/Js/Audio.js index 78e18f2..28fa904 100644 --- a/Js/Audio.js +++ b/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); } diff --git a/Js/Main.js b/Js/Main.js index 4bca81d..f8ef60c 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -133,8 +133,8 @@ function missionDropDownChanged(event) { cont.innerHTML = '' + '