diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-07-04 18:30:47 -0400 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-08-30 21:28:29 -0400 |
commit | 4c3efd2a9a134a15c19ffd232d2e1314b5a64866 (patch) | |
tree | c2339d88924789515f2fd5b1c36edb0f261edf9b /src/library_sdl.js | |
parent | 1f0e8d1c91be731f059587a10578376ede9ab667 (diff) |
Use the Mozilla Audio API in Mix_PlayChannel only if available
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r-- | src/library_sdl.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index e90628d3..9109ea3a 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -1224,8 +1224,10 @@ var LibrarySDL = { } // Either play the element, or load the dynamic data into it if (info.buffer) { - audio['mozSetup'](audio.getAttribute("data-numchannels"), audio.getAttribute("data-frequency")); - audio["mozWriteAudio"](info.buffer); + if (audio && ('mozSetup' in audio)) { // Audio Data API + audio['mozSetup'](audio.getAttribute("data-numchannels"), audio.getAttribute("data-frequency")); + audio["mozWriteAudio"](info.buffer); + } } else { audio.play(); } |