From 3aa76d19c8f9292084600a5079dbece7d7d8ae73 Mon Sep 17 00:00:00 2001 From: Yotam Mann Date: Fri, 5 Sep 2014 01:13:39 -0400 Subject: [PATCH] startMobile on all of the examples Fixes #13 --- examples/Widgets.js | 23 +++++++++++++++++++++++ examples/autoPanner.html | 6 ++---- examples/buses.html | 2 +- examples/duoSynth.html | 2 +- examples/envelope.html | 2 +- examples/fmSynth.html | 2 +- examples/lfo.html | 2 +- examples/monoSynth.html | 2 +- examples/noises.html | 3 ++- examples/oscillator.html | 2 +- examples/pingPongDelay.html | 2 +- examples/player.html | 2 +- examples/score.html | 2 +- examples/signalMath.html | 2 +- examples/stepSequencer.html | 2 +- 15 files changed, 39 insertions(+), 17 deletions(-) diff --git a/examples/Widgets.js b/examples/Widgets.js index f913b849..74455518 100644 --- a/examples/Widgets.js +++ b/examples/Widgets.js @@ -22,6 +22,29 @@ GUI.StartButton.prototype.buttonClicked = function(){ this.callback(); }; +/** + * a start button for mobile browsers which require a touchstart event + * to start the audio + */ +GUI.MobileStart = function(callback){ + if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { + this.element = $("
", {"class" : "StartButton"}) + .appendTo("#Container"); + this.button = $("