sv_loadingurl - html query - IE9 sucks balls.

So, we’ve an event this weekend and I need to play an audio file during the loading screen.

Now, I’ve tried countless scripts from google but nothing seems to let an audio file play in IE9 (I believe this is what gmod uses for loading? I might be wrong).

We have an unfinished loading screen for it, needs some work. But I cannot get the background audio to play in IE at all, can’t get it playing inside Garrysmod either. Is audio blocked? Although again probably an IE issue.

Last code I tried was this, still didn’t work.

<audio id="background_audio" autoplay="autoplay">
  <source src="static/audio/clip.ogg" type="audio/ogg" />
  <source src="static/audio/clip.mp3" type="audio/mpeg" />

<![if (!IE)|(gte IE 9)]>
<a href="#" onclick="document.getElementById('background_audio').muted = true; return false">mute sound</a>

<!--[if lt IE 9]>
<bgsound id="background_snd" src="static/audio/clip.mp3" autostart="true" loop="1">
<a href="#" onclick="document.all['background_snd'].src=''; return false">mute sound</a>

No, GMod uses VALVe’s html control, which is based off of Webkit. I’m not sure how sounds are implemented (if at all) into it.

[editline]25th October 2011[/editline]

Also keep in mind that you are not able to interact with the loading screen, and that clients lock up when sending client data, which will not allow anything to happen.

I’ll just cut it to a 30second clip and do it on initial spawn then.

Be aware that the music wont play for players who have the necesary resources loaded.

Presume you meant who don’t. It loads from a url, not from the server. I guess because gmod caches the url that might disable it.

It will only play while the thread isn’t locked. (While downloading files rather than loading)

You can play music, I believe through SWF or a flash


<embed src="player.swf" id="radioplayer" name="radioplayer" quality="medium" allowScriptAccess="always" width="1" height="1" type="application/x-shockwave-flash" FlashVars="file=music/CharMaking.mp3&volume=20&start=0&duration=0&autostart=true&controlbar=none&dock=false&icons=false">