Music Stops/HTML5 Version/Switching Collection Proxy(NOT SOLVED)



We built an HTML5 version of our current Defold game project.
We ran the HTML5 version on Microsoft Windows 10 Pro 64Bit.

We tried Edge, Firefox, Chrome, & Opera Internet browsers.
While the HTML5 version ran on all 4 above Internet browsers we have audio issues:
When switching scenes, the music stops for about 1/2 a second?

Any ideas on how to solve above audio issue on HTML5 version on Windows 10?
Our working Frames Per Second counter shows the game running full speed (60 FPS).
Let us know, thanks!

You can visit below URL link to run the HTML5 version in your Internet browser:

PS - Game is open-source, if you would like to download the full project then visit below URL link:




EDIT #1:
I Google’d and found:

I tried above and the music still stops between scene changes?
Hope we can fix this?

Music is in OGG file format…

Scene changing code is below:

function on_message(self, message_id, message, sender)
    if message_id == hash("ScreenFaded") then"#proxy_level_" .. CurrentScreen, "disable")"#proxy_level_" .. CurrentScreen, "final")"#proxy_level_" .. CurrentScreen, "unload")
        print(CurrentScreen .. " unload")
    elseif message_id == hash("proxy_unloaded") then"#proxy_level_" .. NextScreen, "async_load")
        print(NextScreen .. " load")
    elseif message_id == hash("proxy_loaded") then, "init"), "enable")
        NextProxyLoaded = true


HTML5 builds are single threaded due to Meltdown and Spectre CPU vulnerabilities. Nothing we nor Defold devs can do about it. A solution is to keep everything loaded at once. Or fade out all audio before doing a load screen when the next things load.




Thanks for the reply…

Does:"#proxy_level_" .. NextScreen, "async_load")

do anything different than “load”?

How would I load everything at game start?
Link to project on GitHub is above.
Some help would be appreciated…




How would I load everything at game start?

Instead of loading/unloading everything between screens you either load it all at the start and enable/disable as needed, or add everything to your initial collection.

I don’t recommend you spend your time doing either of these for your test project though just for HTML5 but keep it in mind if you want to make HTML5 focused games in the future with this limitation in mind.



Thanks for the help!
This is a significant limitation on HTML5 version.
Tired, will hit the source code with a big hammer in the afternoon…




Again, it’s something which impacts all HTML5 games including ones made in other engines like Unity.

Something easy you can try is putting a reference to all of your .sound components and add .sprite components which have a copy of all of the texture atlases you use in your main collection so that the amount of resources you load between screens is reduced.