From d3e79396595f675798af5be8be56efbfd2737ba0 Mon Sep 17 00:00:00 2001 From: TimJentzsch Date: Wed, 29 Jan 2025 22:42:24 +0100 Subject: [PATCH] Fix audio context not restarting automatically (#249) # Objective The script for restarting the audio context for web apps didn't work. This resulted in the app not getting any audio. # Solution The fix is simple: The script for restarting the audio context needs to be called _before_ the app is loaded, I assume to ensure that the creation of the audio context is tracked correctly. # Testing You can test it on the current prototype of the [`bevy_new_2d` port](https://github.com/TheBevyFlock/bevy_new_2d/pull/312). Compare `bevy run --no-default-features web --open` with the current `main` and this branch. This branch should have sound when you click the buttons. --- assets/web/index.html | 83 ++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/assets/web/index.html b/assets/web/index.html index b7de1fc0..b3f61654 100644 --- a/assets/web/index.html +++ b/assets/web/index.html @@ -64,47 +64,8 @@ - - - - + + + +