Forum Academy Marketplace Showcase Pricing Features

Playing audio on iOS Chrome not working

Playing audio on desktop works fine with normal “toggle play audio player” workflow. But once it comes to iOS, it doesn’t work. I’m suspecting pre-loading audio might help in this case, but I’m not experienced with JS. I looked at a few stack overflow, here’s what I have so far, and it’s throwing errors:

var audioFiles = [
“test_audio.wav”, “test_audio2.wav”,

function preloadAudio(url) {
var audio = new Audio();
audio.addEventListener(‘canplaythrough’, loadedAudio, false);
audio.src = url;

for (var i in audioFiles) {

Links I looked at:

Apple is blocking the audio from being played. It should work when the user interacts with the website but not automatically?!