Skip to content

Commit 6577a23

Browse files
adding flag to WebAudioSoundManager indicating if Web Audio implementation is webkit or standards based
1 parent 9098b80 commit 6577a23

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

v3/src/sound/webaudio/WebAudioSoundManager.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ var WebAudioSound = require('./WebAudioSound');
55
var WebAudioSoundManager = new Class({
66
Extends: BaseSoundManager,
77
initialize: function WebAudioSoundManager(game) {
8+
/**
9+
* Flag indicating if Web Audio implementation is webkit or standards based.
10+
* There are certain cases where they have to be handled differently.
11+
*
12+
* https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext
13+
*
14+
* @property {boolean} webkit
15+
*/
16+
this.webkit = !!window['webkitAudioContext'] && !window['AudioContext'];
817
/**
918
* The AudioContext being used for playback.
1019
*

0 commit comments

Comments
 (0)