diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2013-03-13 23:48:49 -0400 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-15 11:53:16 -0700 |
commit | 0dd0d506f77e981258dad30e916c95daeb4aef13 (patch) | |
tree | 79dba565f22b9a3265a1c4b318422313ea3a098c | |
parent | c1b2061c7a703b1665dcb2196d0f8b17b85601b7 (diff) |
Work around two Firefox bugs
-rw-r--r-- | src/library_openal.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/library_openal.js b/src/library_openal.js index 5215bfc3..11dc1ea1 100644 --- a/src/library_openal.js +++ b/src/library_openal.js @@ -86,8 +86,14 @@ var LibraryOpenAL = { var gain = AL.currentContext.ctx.createGain(); var panner = AL.currentContext.ctx.createPanner(); src.connect(gain); - gain.connect(panner); - panner.connect(AL.currentContext.ctx.destination); + if (typeof(webkitAudioContext) == 'function') { + gain.connect(panner); + panner.connect(AL.currentContext.ctx.destination); + } else { + // Work around a Firefox bug (bug 849916) + gain.connect(AL.currentContext.ctx.destination); + } + gain.gain.value = 1; // work around a Firefox bug (bug 850970) AL.currentContext.src.push({src: src, gain: gain, panner: panner}); {{{ makeSetValue('sources', 'i', 'AL.currentContext.src.length', 'i32') }}}; } |