[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
This commit is contained in:
iAmShorty 2014-06-05 12:17:16 +02:00
parent fd8cd88b12
commit 9a3791bd42

View File

@ -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"} ];