Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

No sound in OSX Safari (HTML5 games)

A topic by xalezar created Jan 04, 2019 Views: 1,163 Replies: 2
Viewing posts 1 to 3

Hi everyone, I've been getting this error when running my HTML5 game in Safari since around May 2018:

audio_play_sound failed. WebAudio Context suspended - user must interact with the page before audio can be played.

I think it's due to recent versions of Safari requiring the user to click on a canvas before audio can play. But the error persists after I click on my game canvas and there's still no sound. I did some poking around and it seems HTML5 games are wrapped in an iframe. So I opened the frame source in a new window, where sound will play after I interact with the viewport.

So I don't know, if it would it be possible for the itch.io team to render the HTML5 game directly on the page? (Without the iframe.) I'm sure there are reasons for using an iframe ...

In other browsers, it seems to work fine (audio will play after the user clicks on the canvas).

Thanks for checking it out.

Haven't received any replies yet, so I thought I'd bump it. Wondering if anyone else is experiencing this issue? It's pretty serious for game creators who distribute via the HTML5 platform ...

This is a game engine issue. The message comes from the browser itself, it's part of the initiative of browser vendors to prevent annoying stuff from playing automatically. You have to manually resume your context from some kind of a user interaction event.

This topic has been auto-archived and can no longer be posted in because there haven't been any posts in a while.