• gazduire

English: WordPress Audio Player in sidebar

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:d 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.

adaugat pe by madalin in wordpress

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.

Comments have been disabled for this post.
Sort: Newest | Oldest

You're welcome reesmaxwell :)

Thanks again for this tutorial!

I was having an issue getting your solution to work, until I realized that I had copy and pasted the text you show above ... but many of the straight quotes have turned into angled or smart quotes, and those just won't work.

ANYONE trying to make this work: Please take the time to check all of your quotes, making sure they are of the straight variety.

was searching for means to put audio on sidebar. thank you, need to try this out...

mersi, o sa-l folosesc si eu :D