summaryrefslogtreecommitdiff
path: root/env.js
diff options
context:
space:
mode:
Diffstat (limited to 'env.js')
-rw-r--r--env.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/env.js b/env.js
index 04fb6fb..ddfef4a 100644
--- a/env.js
+++ b/env.js
@@ -23,6 +23,18 @@ var environment = (function(){
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")
+ var button = $("<div>").attr("id", "Button").text("Enter").appendTo(element)
+ StartAudioContext.setContext(Tone.context)
+ StartAudioContext.on(button)
+ StartAudioContext.onStarted(function(){
+ element.remove()
+ })
}
environment.build = function(){
environment.scale()