diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-09-11 15:50:47 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-09-11 15:50:47 -0400 |
| commit | 7243fd7cf75e59b2ea45def413788020a663679f (patch) | |
| tree | 5322fe964fa613d1938faee31b063b1eae7fc957 | |
| parent | 642a0e99cfb4aeaa71cc1ac51739608ef6225b99 (diff) | |
is stated
| -rw-r--r-- | env.js | 11 | ||||
| -rw-r--r-- | js/vendor/StartAudioContext.js | 1 |
2 files changed, 8 insertions, 4 deletions
@@ -18,14 +18,16 @@ var environment = (function(){ ] environment.init = function(){ - environment.ready() + if (is_mobile) { + environment.request_audio_context() + } + else { + environment.ready() + } } environment.ready = function(){ environment.build() environment.bind() - if (is_mobile) { - environment.request_audio_context() - } } environment.request_audio_context = function(){ var element = $("<div>", {"id" : "MobileStart"}).appendTo("body") @@ -34,6 +36,7 @@ var environment = (function(){ StartAudioContext.on(button) StartAudioContext.onStarted(function(){ element.remove() + environment.ready() }) } environment.build = function(){ diff --git a/js/vendor/StartAudioContext.js b/js/vendor/StartAudioContext.js index 905878a..1823b04 100644 --- a/js/vendor/StartAudioContext.js +++ b/js/vendor/StartAudioContext.js @@ -78,6 +78,7 @@ StartAudioContext.onStarted = function(cb){ //if it's already started, invoke the callback if (StartAudioContext.isStarted()){ + console.log("is started") cb(); } else { StartAudioContext._onStarted.push(cb); |
