diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2014-01-02 14:43:36 -0500 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2014-01-02 14:43:36 -0500 |
commit | 4a4805603d4e810802533fa1f9d92ead10bcddbb (patch) | |
tree | fd871e427760db1b130aafdb1cca3dcfde5e8251 /www/js/api.js | |
parent | dcc3c18bd7689d2ce625e7af38267ca0b43b1267 (diff) | |
download | html5ks-4a4805603d4e810802533fa1f9d92ead10bcddbb.tar.xz html5ks-4a4805603d4e810802533fa1f9d92ead10bcddbb.zip |
Fix ambient volume.
soundVolume -> sfxVolume
Diffstat (limited to 'www/js/api.js')
-rw-r--r-- | www/js/api.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/www/js/api.js b/www/js/api.js index a46511f..22342c5 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -38,15 +38,17 @@ window.html5ks.api = new (function () { } html5ks.elements.audio[channel] = audio; - var src = "dump/"; + var src = "dump/", volume; switch (channel) { case "music": src += "bgm/" + html5ks.data.music[name]; + volume = html5ks.persistent.musicVolume; break; case "ambient": case "sound": src += "sfx/" + html5ks.data.sfx[name]; + volume = html5ks.persistent.sfxVolume; } ["opus", "ogg", "m4a", "wav"].some(function (type) { @@ -67,7 +69,6 @@ window.html5ks.api = new (function () { throw new Error(e); }; audio.load(); - var volume = html5ks.persistent[channel + "Volume"]; audio.volume = fade ? 0 : volume; audio.play(); return deferred.promise; |