diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-09-11 15:49:18 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-09-11 15:49:18 -0400 |
| commit | 642a0e99cfb4aeaa71cc1ac51739608ef6225b99 (patch) | |
| tree | 450d97fa941216306471f5a99f55c291f3e39bd0 /env.js | |
| parent | 5d18cc7380a076a0b02dff6ef47c85685d317d7e (diff) | |
js/vendor/StartAudioContext.js
Diffstat (limited to 'env.js')
| -rw-r--r-- | env.js | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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() |
