From bd28c76f662039cf289e2e224e7841eebeaf6fe8 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Mon, 2 Sep 2013 19:52:53 -0400 Subject: play URL bug --- www/js/api.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/www/js/api.js b/www/js/api.js index fae899e..4d746a5 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -40,7 +40,17 @@ window.html5ks.api = { } html5ks.elements.audio[channel] = audio; - var src = "dump/" + (channel === "music" ? html5ks.data.music[name] : html5ks.data.sfx[name]); + var src = "dump/"; + + switch (channel) { + case "music": + src += "bgm/" + html5ks.data.music[name]; + break; + case "ambient": + case "sound": + src += "sfx/" + html5ks.data.sfx[name]; + } + if (Modernizr.audio.opus) { audio.src = src + ".opus"; } else if (Modernizr.audio.ogg) { -- cgit v1.2.3-70-g09d2