I’m working on a project, it is on his final steps… but testing on devices, I noticed than Audio on iOs dont work. Neither Chrome or Safari. But Android Chrome, Safari, and desktop works perfectly.
The audio contexts is created while the page load, but is resumed when the user interacts (clic on the orange screen) that make the ambient sound play, and the other sounds plays when the ball hits the scene elements.
All audio sources are in .mp3
I’m not sure this helps but you should try to remove this warning:
The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.
Like mentioned in the warning you should only access the audio context after a user interaction like a button press. Accessing the audio context happens as soon as you create instances of audio classes in three.js.
I have two listeners. Wich mean two context.
The first control the ambient sound. The second control the sound fx, bounce, hit, etc.
I modify the code, creating the first just after the user interacts with the orange overlay. And keeps without playing the ambient sound.
Can check here, same link. https://bbc-pong.netlify.app/
By other wise, check this project and it works perfectly!!! (even with the console warnings)
Reading documentation, to make video and audio work properly on iOs, the HTML Audio tag must have ‘playsinline’ and ‘muted’ atrributes. But how can I put it here?