Skip to content

Commit 2d2bf4c

Browse files
Added check for touch events when trying to unlock web audio on iOS devices
1 parent 01e5274 commit 2d2bf4c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

v3/src/sound/webaudio/WebAudioSoundManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ var WebAudioSoundManager = new Class({
7171
*/
7272
unlock: function () {
7373
var _this = this;
74-
if (this.context.state === 'suspended') {
74+
if (this.context.state === 'suspended' && 'ontouchstart' in window) {
7575
var unlock_1 = function () {
7676
_this.context.resume().then(function () {
7777
document.body.removeEventListener('touchstart', unlock_1);

0 commit comments

Comments
 (0)