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:
parent
01e5274c76
commit
2d2bf4c0e3
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue