2
0
Fork 0
mirror of https://github.com/photonstorm/phaser synced 2025-03-04 15:27:31 +00:00

Added check for touch events when trying to unlock web audio on iOS devices

This commit is contained in:
Pavle Goloskokovic 2018-01-06 15:03:28 +01:00
parent 01e5274c76
commit 2d2bf4c0e3

View file

@ -71,7 +71,7 @@ var WebAudioSoundManager = new Class({
*/ */
unlock: function () { unlock: function () {
var _this = this; var _this = this;
if (this.context.state === 'suspended') { if (this.context.state === 'suspended' && 'ontouchstart' in window) {
var unlock_1 = function () { var unlock_1 = function () {
_this.context.resume().then(function () { _this.context.resume().then(function () {
document.body.removeEventListener('touchstart', unlock_1); document.body.removeEventListener('touchstart', unlock_1);