Skip to content

Commit c20b06b

Browse files
committed
Made most properties public. Fix phaserjs#5531
* The `WebAudioSoundManager.createAudioContext` method is no longer private. * The `WebAudioSoundManager.context` property is no longer private. * The `WebAudioSoundManager.masterMuteNode` property is no longer private. * The `WebAudioSoundManager.masterVolumeNode` property is no longer private. * The `WebAudioSoundManager.destination` property is no longer private.
1 parent 1ebfdef commit c20b06b

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/sound/webaudio/WebAudioSoundManager.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ var WebAudioSoundManager = new Class({
4141
*
4242
* @name Phaser.Sound.WebAudioSoundManager#context
4343
* @type {AudioContext}
44-
* @private
4544
* @since 3.0.0
4645
*/
4746
this.context = this.createAudioContext(game);
@@ -51,7 +50,6 @@ var WebAudioSoundManager = new Class({
5150
*
5251
* @name Phaser.Sound.WebAudioSoundManager#masterMuteNode
5352
* @type {GainNode}
54-
* @private
5553
* @since 3.0.0
5654
*/
5755
this.masterMuteNode = this.context.createGain();
@@ -61,7 +59,6 @@ var WebAudioSoundManager = new Class({
6159
*
6260
* @name Phaser.Sound.WebAudioSoundManager#masterVolumeNode
6361
* @type {GainNode}
64-
* @private
6562
* @since 3.0.0
6663
*/
6764
this.masterVolumeNode = this.context.createGain();
@@ -75,7 +72,6 @@ var WebAudioSoundManager = new Class({
7572
*
7673
* @name Phaser.Sound.WebAudioSoundManager#destination
7774
* @type {AudioNode}
78-
* @private
7975
* @since 3.0.0
8076
*/
8177
this.destination = this.masterMuteNode;
@@ -102,7 +98,6 @@ var WebAudioSoundManager = new Class({
10298
* and you want to reuse already instantiated AudioContext.
10399
*
104100
* @method Phaser.Sound.WebAudioSoundManager#createAudioContext
105-
* @private
106101
* @since 3.0.0
107102
*
108103
* @param {Phaser.Game} game - Reference to the current game instance.
@@ -120,7 +115,14 @@ var WebAudioSoundManager = new Class({
120115
return audioConfig.context;
121116
}
122117

123-
return new AudioContext();
118+
if (window.hasOwnProperty('AudioContext'))
119+
{
120+
return new AudioContext();
121+
}
122+
else if (window.hasOwnProperty('webkitAudioContext'))
123+
{
124+
return new window.webkitAudioContext();
125+
}
124126
},
125127

126128
/**

0 commit comments

Comments
 (0)