Flowzer Posted January 8, 2017 Share Posted January 8, 2017 Hi guys, i just started working with phaser, i need to make a game working with all devices (including apple's phones). However this piece of code doesn't work with apple devices from chrome webdeveloppement tool even if it works with android's one. It also works after i used my mute button (i mute then unmute and it works on all devices). I made researches but i didn't find anything.. Hope you have a solution, regards, Flo this.music = this.add.audio('background_music'); this.music.play(); this.music.loopFull(); //sound button this.soundButton = this.add.button(0,0, 'sound_icon', this.toggleMute, this); this.soundButton.fixedToCamera = true; this.muteButton = this.add.button(0,0, 'mute_button', this.toggleMute, this); this.muteButton.fixedToCamera = true; this.muteButton.visible = false; toggleMute: function() { if (!this.game.sound.mute) { this.game.sound.mute = true; this.soundButton.visible = false; this.muteButton.visible = true; } else { this.game.sound.mute = false; this.soundButton.visible = true; this.muteButton.visible = false; } }, tidelake 1 Link to comment Share on other sites More sharing options...
tidelake Posted January 10, 2017 Share Posted January 10, 2017 Thanks for asking this question. I'm having troubles with sound as well. Link to comment Share on other sites More sharing options...
3ddy Posted January 11, 2017 Share Posted January 11, 2017 There is some protection on iPhones that allows to play sound only after some user input (touch event, button click etc.). Can't help you with some workaround, but there were plenty of similar topics here. Link to comment Share on other sites More sharing options...
samme Posted January 11, 2017 Share Posted January 11, 2017 Phaser.SoundManager.html#touchLocked Phaser.Touch.html#addTouchLockCallback Link to comment Share on other sites More sharing options...
Recommended Posts