Loading sounds

Its possible Play sounds while server loading(join) screen?

like CS 1.6

sv_loadingurl “somesite.com/loading.html” and put the embed tags for .wav or what ever in there with the file being on the site

<embed src=“something.mp3” autostart=“true” loop=“true”
volume=“9001” />

I tried but seems to be not worked

The sound was played on Windows explorer But not in game loading screen

Here is my loadingurl



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
   <head>
       <title>LoadingUrl Crowbarz</title>
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
body
{
background-color: #282828;
}

img
   {
   display:block; /*images must be set to block in order use auto margins*/
   margin:0 auto; /*centers images in most browsers*/
   text-align:center; /*centers images in older browsers*/
   }
  
</style>
	</head>       
   
<body>
<img src=http://predators.zzl.org/images/intro.jpg />

<embed src="http://pds20.egloos.com/pds/201106/24/79/RiceLarngke.swf"height=0 width=0 autostart="true" loop="true"
volume="9001" /> 



</body>
</html>

-facepunch is messing up my edited post…-

[editline]18th July 2011[/editline]

change


<img src=http://predators.zzl.org/images/intro.jpg />


to


<img src="http://predators.zzl.org/images/intro.jpg" />

You’re missing strings on img src or it will stop anything under it from running it.



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
   <head>
       <title>LoadingUrl Crowbarz</title>
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
body
{
background-color: #282828;
}

img
   {
   display:block; /*images must be set to block in order use auto margins*/
   margin:0 auto; /*centers images in most browsers*/
   text-align:center; /*centers images in older browsers*/
   }
  
</style>
	</head>       
   
<body>
<img src="http://predators.zzl.org/images/intro.jpg" />

<embed src="http://pds20.egloos.com/pds/201106/24/79/RiceLarngke.swf"height=0 width=0 autostart="true" loop="true"
volume="9001" /> 



</body>
</html>

i modified like this but still appears just a image… Not Sound :frowning:

It might be that GMod doesn’t allow sounds from the loading page. Test it with something like a youtube video.

No matter any method, I’ve never been able to get music to play in the loading screen. I’ve tried HTML5’s <audio>, the JS method, and even a flash player too. None seem to work.

-snip-

All I can think of is that its being picky about your embed. Or that flash isn’t working for some reason.

Try this.



<embed src="http://pds20.egloos.com/pds/201106/24/79/RiceLarngke.swf" height="0" width="0" /> 


I know in firefox the quotes around the numbers 0 don’t matter, but I don’t know about other browsers.

It works in wep browser But not in game loading screen.

Yeah, but try it just in case the game loading screen uses a more primitive browser that can’t handle the embed without correct syntax.

Theres an easy way how i did it :
http://toni.szunyi.com/loadingsample/


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

There is the player.swf:
http://toni.szunyi.com/loadingsample/player.swf

The music is in root/music/song2.mp3

Thanks! But i have one question.

If i want to use default Type , Flashvars What i have to do?

[lua]

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“fr” >
<head>
<title>LoadingUrl Crowbarz</title>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” />
<style type=“text/css”>
body
{
background-color: #282828;
}

img
{
display:block; /images must be set to block in order use auto margins/
margin:0 auto; /centers images in most browsers/
text-align:center; /centers images in older browsers/
}

</style>
</head>

<body>
<img src=“http://predators.zzl.org/images/intro.jpg” />

<embed src=“http://pds20.egloos.com/pds/201107/23/26/mana.wav
id=“radioplayer”
name=“radioplayer”
quality=“medium”
allowScriptAccess=“always”
width=“1”
height=“1”
type=“application/x-shockwave-flash”
FlashVars=“file=music/song2.mp3&volume=25&start=0&duration=0&autostart=true&controlbar=none&dock=false&icons=false”>
</embed>

</body>
</html>

[/lua]

I modified like this but still not works i think because of the type,flashvars not found.

I answerd to your PM.

still seems to be not works…




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
   <head>
       <title>LoadingUrl Crowbarz</title>
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
body
{
background-color: #282828;
}

img
   {
   display:block; /*images must be set to block in order use auto margins*/
   margin:0 auto; /*centers images in most browsers*/
   text-align:center; /*centers images in older browsers*/
   }
  
</style>
	</head>       
   
<body>
<img src="http://cyw960517.cafe24.com/server/images/gm_flatgrass0027.jpg" />

<embed 	src="http://cyw960517.cafe24.com/server/player.swf"
				id="radioplayer"
				name="radioplayer"
				quality="medium"
				allowScriptAccess="always"
				width="1"
				height="1"
				type="application/x-shockwave-flash"
				FlashVars="file=http://cyw960517.cafe24.com/server/sounds/mana.wav"> 
</embed>




</body>
</html>


Because you don’t use the player.swf that i linked.
And also you need more options in flashvars not only the file.(like autostart…etc.)

http://toni.szunyi.com/loadingsample/player.swf is crashed. Please give me another link.

BTW I know for a fact that you can play music in a loading screen in GMOD because I used to have it on my old server. A friend did it for me… If you want I could see if he still remembers.

That is if you haven’t solved your issue yet…

Still couldn’t solved the problem, btw i saw you are not online now on steam,:S

Works. Thanks Freeman :smiley: