Because a friend of mine asked about this here’s a quick and dirty howto on how you can get your mp3 files played on your website.
I will recommend using the extended XSPF player from boutell, which support autoresume, and randomplay.
I will use the slim (the one you can see in my sidebar) version of the player for this tutorial.
First of all download the audio player, and upload to a folder called player (you should have http://your-site.com/player) where player is your desired folder.
You should have a folder called Slim. Upload the files in that directory to the player (or whatever folder you choose) folder of your website.
Next, create an xspf playlist named playlist.xspf (the xspf extension is very important) that should look like this:
<?xml version=”1.0″ encoding=”UTF-8″?>
<playlist version=”0″ xmlns = “http://xspf.org/ns/0/”>
<trackList>
<track>
<location>http://YOUR-DOMAIN.COM/player/Carbon_Based_Lifeforms_-_Comsat.mp3</location>
<annotation>Carbon Based Life Forms – Comsat</annotation>
</track>
<track>
<location>http://YOUR-DOMAIN.COM/player/Faithless – Salva mea.mp3</location>
<annotation>Faithless – Salva Mea</annotation>
</track>
<track>
<location>http://YOUR-DOMAIN.COM/player/Faithless – Drifting away.mp3</location>
<annotation>Faithless – Drifting away</annotation>
</track>
<track>
<location>http://YOUR-DOMAIN.COM/player/Afro Celt Sound System – Eireann.mp3</location>
<annotation>Afro Celt Sound System – Eireann</annotation>
</track>
</trackList>
</playlist>
!! Make sure you set the correct folder and that you modify the YOUR-DOMAIN.COM, to your website’s address !!
Next, open up sidebar.php (or whatever file you want) and where you want your player to appear:
<object classid=”clsid
27cdb6e-ae6d-11cf-96b8-444553540000″ codebase=”http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0″ id=”xspf_player” align=”middle” height=”15″ width=”300″>
<param name=”allowScriptAccess” value=”sameDomain”>
<param name=”movie” value=”http://YOUR-DOMAIN.COM/player/xspf_player_slim.swf?playlist_url=http://YOUR-DOMAIN.COM/player/playlist.xspf&autoplay=true&autoresume=1&shuffle=1″>
<param name=”quality” value=”high”>
<param name=”bgcolor” value=”#990000″>
<param name=”random” value=”1″>
<embed src=”http://YOUR-DOMAIN.COM/player/xspf_player_slim.swf?playlist_url=http://YOUR-DOMAIN.COM/player/playlist.xspf&autoplay=true&autoresume=1&shuffle=1″ quality=”high” bgcolor=”#990000″ name=”xspf_player” allowscriptaccess=”sameDomain” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” align=”center” height=”15″ width=”300″>
</object>
!! Make sure you set the correct folder and that you modify the YOUR-DOMAIN.COM, to your website’s address !!
This will provide you with an audio player of your files, if you managed to correctly create the xspf playlist. This player (settings i’m using) will provide autoresume (your visitors will hate it when they’ll hear the same song over and over), autoplay, and random play.
Hope this helps. Don’t forget to provide your feedback on this.
About madalin
Sunt un tip franc, care spune lucrurilor pe nume. Sunt pătimaş şi perseverent, dar uneori mă plictisesc repede. Încerc să fiu un om bun. În cele mai multe situaţii, îmi reuşeşte. În detrimentul meu. Vrei mai multe ? Uită-te pe pagina despre mine.