[SOLVED] Sound not working on iOS

iOS does not allow sounds to be played unless you start playing them as a result of user interaction. So you could do something like:

var audiosource = this.entity.audiosource;
var startSound = function () {
    document.removeEventListener('click', startSound);
    audiosource.play('mysound');
}

var isIOS = /iPad|iPhone|iPod/.test(navigator.platform);
if (isIOS)
    document.addEventListener('click', startSound);
1 Like