@vpmedia/phaser 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpmedia/phaser",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "@vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2",
5
5
  "author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@ export default class {
37
37
  this.useXDomainRequest = false;
38
38
  this._warnedAboutXDomainRequest = false;
39
39
  this.enableParallel = true;
40
- this.maxParallelDownloads = 6;
40
+ this.maxParallelDownloads = 5;
41
41
  this._withSyncPointDepth = 0;
42
42
  this._fileList = [];
43
43
  this._flightQueue = [];
@@ -796,8 +796,8 @@ export default class {
796
796
  }
797
797
 
798
798
  fileError(file, xhr, reason) {
799
- const url = file.requestUrl || this.transformUrl(file.url, file);
800
- let message = 'error loading asset from URL ' + url;
799
+ // const url = file.requestUrl || this.transformUrl(file.url, file);
800
+ let message = 'Error loading asset';
801
801
  if (!reason && xhr) {
802
802
  reason = xhr.status;
803
803
  }
@@ -156,17 +156,14 @@ export default class {
156
156
  if (soundData) {
157
157
  if (this.game.cache.isSoundDecoded(key) === false) {
158
158
  this.game.cache.updateSound(key, 'isDecoding', true);
159
- const scope = this;
160
- try {
161
- this.context.decodeAudioData(soundData, (buffer) => {
162
- if (buffer) {
163
- scope.game.cache.decodedSound(key, buffer);
164
- scope.onSoundDecode.dispatch(key, sound);
165
- }
159
+ this.context.decodeAudioData(soundData)
160
+ .then((buffer) => {
161
+ this.game.cache.decodedSound(key, buffer);
162
+ this.onSoundDecode.dispatch(key, sound);
163
+ })
164
+ .catch((e) => {
165
+ this.game.exceptionHandler(e);
166
166
  });
167
- } catch (e) {
168
- scope.game.exceptionHandler(e);
169
- }
170
167
  }
171
168
  }
172
169
  }