bevyengine / bevy_github_ci_template

Apache License 2.0
202 stars 45 forks source link

Include workaround for AudioContext requiring interaction #17

Closed hymm closed 1 year ago

hymm commented 1 year ago

Should the template include this workaround for AudioContexts?

https://developer.chrome.com/blog/web-audio-autoplay/#moving-forward

I think itch.io does something for this already, but it's fixes some issues with sounds not playing when running on other web pages.

mockersf commented 1 year ago

Ooh, good find!

What happens if we add this when deploying on itch.io?

hymm commented 1 year ago

What happens if we add this when deploying on itch.io?

I think it should be fine. I deployed to itch.io in the past with a similar workaround I took from https://github.com/NiklasEi/bevy_game_template.

rparrett commented 1 year ago

I also use this workaround on itch.

It is only necessary when using the Automatically start on page load option (without that option the game is only loaded after the page is interacted with) but should be harmless otherwise.