From 9a3791bd423257f683c73b3ddc5905d82acbef77 Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Thu, 5 Jun 2014 12:17:16 +0200 Subject: [PATCH] [UPDATE] hide toggle on mobile devices mobile devices can't start automatically, starting sound only works with a touch event. so we don't create the object and remove the toggle from footer --- templates/bootstrap/dashboard/js/api.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/bootstrap/dashboard/js/api.tpl b/templates/bootstrap/dashboard/js/api.tpl index 91891fe1..e73b4859 100644 --- a/templates/bootstrap/dashboard/js/api.tpl +++ b/templates/bootstrap/dashboard/js/api.tpl @@ -9,6 +9,9 @@ $(document).ready(function(){ // check if the default plugins can be loaded, if not, disable button and don't load soundjs if (!createjs.Sound.initializeDefaultPlugins()) { $('#togglesound').hide(); + // don't create object and hide toggle on mobile devices. must be started inside a touch event, else sound doesn't start + } else if (createjs.Sound.BrowserDetect.isIOS || createjs.Sound.BrowserDetect.isAndroid || createjs.Sound.BrowserDetect.isBlackberry) { + $('#togglesound').hide(); } else { var audioPath = "{/literal}{$PATH}{literal}/audio/"; var manifest = [ {id:"ding", src:"ding.ogg"} ];