on a particular website I currently have a script that randomises the background music that is played each time the website is accessed. It grabs the file randomly from a sound folder and plays. Everything works great.
PHP
$songs = glob('snd/*.*');
HTML
<embed src="swf/player.swf" id="radioplayer" name="radioplayer" quality="medium" allowScriptAccess="always" width="1" height="1" type="application/x-shockwave-flash" FlashVars="file=<?php echo $song; ?>&volume=10&start=0&duration=0&autostart=true&controlbar=none&dock=false&icons=false&loop=1">
However, I would like to expand this a little more.
It is used as a loading screen for a gameserver which requires custom files to be downloaded to the client. Once the song finishes, it's just silence. I'm wondering: is it possible that when the song is finished a new song is selected randomly, like how it was the first time, and then played? The only thing is, even though I want the selection to be random I do not want it to play the song that was just played.
Hopefully this is possible and thanks in advance.
Note
It uses a flash player to play the songs, as you can see. If this is not a viable method of playing the songs with my request above I'm welcome to alternative methods, provided I can control the volume of the audio that plays.
Edit
To try and kill two birds with one stone, the webpage's background image also changes depending on which map the server is currently using. I do not have images for each map I add as I add more all the time, would it be possible to set the background to a default image instead of it just being blank?