@vpmedia/phaser 1.0.7 → 1.0.8
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/README.md +1 -1
- package/dist/phaser.cjs +1 -1
- package/dist/phaser.cjs.LICENSE.txt +1 -1
- package/dist/phaser.cjs.map +1 -1
- package/dist/phaser.js +1 -1
- package/dist/phaser.js.LICENSE.txt +1 -1
- package/dist/phaser.js.map +1 -1
- package/package.json +1 -1
- package/src/phaser/core/game.js +2 -0
- package/src/phaser/core/sound_manager.js +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpmedia/phaser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
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",
|
package/src/phaser/core/game.js
CHANGED
|
@@ -211,6 +211,8 @@ export default class {
|
|
|
211
211
|
this.parseConfigElement(config, 'clearBeforeRender', true);
|
|
212
212
|
// The Renderer this game will use. Either PowerGamer.Const.RENDER_AUTO, PowerGamer.Const.RENDER_CANVAS, PowerGamer.Const.RENDER_WEBGL, or PowerGamer.Const.RENDER_HEADLESS.
|
|
213
213
|
this.parseConfigElement(config, 'renderType', RENDER_AUTO);
|
|
214
|
+
// Force audio disabled
|
|
215
|
+
this.parseConfigElement(config, 'isForceDisabledAudio', false);
|
|
214
216
|
if (config.renderer) {
|
|
215
217
|
this.config.renderType = config.renderer;
|
|
216
218
|
}
|
|
@@ -33,6 +33,10 @@ export default class {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
boot() {
|
|
36
|
+
if (this.game.config.isForceDisabledAudio) {
|
|
37
|
+
this.noAudio = true;
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
36
40
|
if (window.PhaserRegistry && window.PhaserRegistry.audioContext) {
|
|
37
41
|
this.context = window.PhaserRegistry.audioContext;
|
|
38
42
|
} else if (window.AudioContext) {
|
|
@@ -42,6 +46,7 @@ export default class {
|
|
|
42
46
|
this.context = null;
|
|
43
47
|
this.noAudio = true;
|
|
44
48
|
this.touchLocked = false;
|
|
49
|
+
this.game.exceptionHandler(e);
|
|
45
50
|
}
|
|
46
51
|
} else if (window.webkitAudioContext) {
|
|
47
52
|
try {
|
|
@@ -50,6 +55,7 @@ export default class {
|
|
|
50
55
|
this.context = null;
|
|
51
56
|
this.noAudio = true;
|
|
52
57
|
this.touchLocked = false;
|
|
58
|
+
this.game.exceptionHandler(e);
|
|
53
59
|
}
|
|
54
60
|
}
|
|
55
61
|
if (this.context === null || (this.context && this.context.createGain === undefined && this.context.createGainNode === undefined)) {
|