Open nekobungi opened 3 years ago
This is an issue I've had on iOS since day one and I should've thought to report it. Audio just doesn't play on iOS. Very, very occasionally it will work but it seems random. Even setting it so the game doesn't autoplay any audio, and only plays audio on player input doesn't solve the issue
It's really cool that you found a solution to the problem. I'm going to implement that in my next version
Describe the bug Any game projects exported as web does not play audio at all, no matter what the players do.
To Reproduce Steps to reproduce the behavior:
Expected behavior Sound plays normally after a mouse click, a screen touch or a keyboard input
Platform (please complete the following information):
Platforms for playing exported games:
Additional context The reason why there is no sound is due to Safari's mechanism to block auto-playing medias with sound. The latest version of Safari has more stricter blocking mechanism, so the games that were fine before will not work properly now. On iOS/iPadOS, the problem occurs in all browsers because they all use the same layout engine as Safari.
By the way, you can avoid the problem by modifying one of the exported files by following the steps:
// var soundInitTimer = setInterval(function() { // if (GameBoyEmulatorInitialized()) { // initSound(); // clearTimeout(soundInitTimer); // } // }, 16);