This is a really awesome mp3 player that I made to mimic an actionscript 2 xspf player, but built with actionscript 3 and flex… it’s great and open source!

Finally it’s here…

OPEN SOURCE FLEX XML MP3 PLAYER

Flex xml mp3 player

Basically you can specify an xml playlist from the url, and have it play whatever is in the playlist…

The links for the examples are on the right side.

You can also specify the playlist in the url if you’d like:

http://cctracker.axelscript.com/Examples/xspfPlayer/bin/xmlPlayer.cfm?playlist%5Furl=http://killtheheart.com/playlist.xml

here are the variables you can use:

  • playlist_url : the url of the xspf file to load
  • podcast_mode : (true/false) if true the playlist url could be an rss feed to a podcast and it will play the all of the podcasts
  • repeat_playlist : boolean value that make the repeats the playlist after the end
  • song_url : String the href location of a single song you want to play, when this is used playlist_url is ignored
  • song_title : the name of the song you want to use

The music player can also be used to play single mp3 files instead of playlists, the parameters are:

  • song_url : the url of the single mp3 you want to play
  • song_title : the text to replace the players default’s

and you could even create a custom playlist on your site (this link doesn’t work it’s an example) http://flexcoders.nl/someplaylist.xml

and as long as it was in the right format, it’s all good….

here is the format http://examples.axelscript.com/Examples/xspfPlayer/bin/data.xml

right click and view source to actually copy and paste xml…

It’s loosely based on the xspf (‘spiff’) standard, it’s an open source shareable playlist format…

Here is the documentation on it:

http://www.xspf.org/xspf-v1.html#rfc.section.4.1.1.2

here is another example of a playlist

http://www.killtheheart.com/playlist.xml

in June 19th, 2008 at 12:43 pm

[...] Our XML MP3 Player is even on this link! woot! [...]

rubing said,
in August 29th, 2008 at 8:15 pm

This is awesome how! How do you embed the player so it stays in the same page rather than opening a new one??

rubing said,
in August 30th, 2008 at 8:27 am

Ok, I am clueless about coldfusion. Would appreciate knowing how to remove it.

rubing said,
in August 30th, 2008 at 8:46 am

If i just delete all the cfm stuff it gives me an error and doesn’t work.

rubing said,
in August 30th, 2008 at 10:29 am

OK, now i see what was wrong. The playlist I was trying to use was from a dynamically generated php page. I guess your player doesn’t like php pages. :-(

juszczum said,
in December 9th, 2008 at 3:32 am

Hi Axel, I am new into the Flex programming,
I need to convert this player from Application
to a Control, to use as a control in my flexx app, or use your of another way.
Please, help me for I can use this!!!.

Thanks.

Marcelo from Argentina

sine said,
in February 23rd, 2009 at 7:04 pm

Hello,
I am trying to use the xml mp3player that you built as a module inside my showreel. First of all thanks for the application. A huge gift. However there is one simple thing that I cannot manage to make happen… That is to stop the audio from continuing to play when I navigate away to another module. The player unloads, but the sound continues… Please how can I stop it?
Presently I am loading and unloading modules via a ToggleButtonBar itemclick function in the main app.: like so:

public function onFirstClick(event:ItemClickEvent):void {
_modUrl = “modules/” + event.label + “.swf”;
moduleHandler(_modUrl);

– which works fine, from the main app. or when called from modules.

I tried adding

if(_modUrl == “modules/Telly.swf” || “modules/Print.swf”) {
mp3player.stop();

but that doesn’t work… I am still learning Flex and Action Script 3.0 – and this has me stumped!
I’m desperate to finish my showreel so I can apply for a job..

I hope you might be able to give me a few tips.

Thanks in advance,

Sine

Leave A Reply

 Username (*required)

 Email Address (*private)

 Website (*optional)