Open Source Flex XML MP3 Player (xspf)

  • album
    • the album name of this track… leave blank if you wish this shows up in the big version on the bottom of the “now playing” view

  • annotaion
    • unused at the moment, please refer to xspf documenation for information

  • artist
    • the artist name of this track… leave blank if you wish this shows up in the big version in the middle of the “now playing” view

  • creator
    • the developer… this is just documentation in my eyes, but please refer to xspf docs

  • image
    • in the big version of the player, if you specify a url of the image you want, it will show on the left while the track is playing

  • info
    • there is an info button on the big version, it’s simply another URL you could specify, and it will produce a popup window for it.

  • link
    • there is an image in the big version, specify a URL here, and when you click on the album in the big version it will give you a popup to the address you specify.

  • location
    • the most import piece of the puzzle
    • the url of the song (can be a URL, or relative path)

  • timeEnd
    • use this to pause the song at a certain point, say you only want the user to listen to 0:15 – 0:20, make the timeEnd 20000 (not exact but close enough, it’s milliseconds)
    • specify a 0 to just play through the end
    • NOTE: it is milliseconds!

  • timeStart
    • use this to start the song at a certain point, say you only want the user to listen to 0:15 – 0:20, make the timeStart 15000 (not exact but close enough, it’s milliseconds)
    • specify a 0 to just play from the begining
    • NOTE: it is milliseconds!

  • title
    • this is the track title – it is displayed in the top of the ‘now playing’ view in the big version (note: doesnt necessarily have to be the track title it could just be whatever you chose to name the file… it’s up to you)

  • trackNum
    • unused at the moment, but could be used for documentation


    1. Download whatever version you want (big/small) by clicking the links above
      • if your just using the product and dont care about the source, click on the links under Download section, that dont have the word “source”
    2. When you download it, there are 4 files
      • data.xml (sample xml file)
      • swfobject.js (swfobject.js used for including the swf file in your html/cfm/php/whatever else page) (NOTE: i’ll try to keep up on new versions of swfobject but no gurantees if you want the latest and greatest go to
      • xmlPlayer(Small/Big).cfm (Small/Big depending on the version you downloaded… these are example cfm files to reference to for using swfObject to include your .swf… if you have any experience with using flash files on html pages, you should have not problem googling other ways besides swfobject)
      • xmlPlayer(Small/Big).swf (this is the actual swf file to use)
    3. Place those files in whatever folder you would like under your webroot and then run the page in a browser (http://yourdomain/whereyouputthefiles/index.cfm (if you dont have coldfusion, please open up the cfm file with wordpad, and fix the code, it’s pretty self explanatory, mostly it’s just html)
    4. When you run the page, a default playlist will start playing if you have not provided one on the url
    5. (i.e.) http://yourdomain/whereyouputthefiles/index.cfm?playlist_url=data.xml
    6. please submit bugs to the google code site! I WILL FIX THEM I PROMISE! (the issues tab) Google Code

    Page 2 of 2 | Previous page

    8 comments on this post.
    1. Cool Component Links | Axelology:

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

    2. rubing:

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

    3. rubing:

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

    4. rubing:

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

    5. rubing:

      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. 🙁

    6. juszczum:

      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!!!.


      Marcelo from Argentina

    7. sine:

      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”;

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

      I tried adding

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

      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,


    8. Christoph:

      Very nice mp3 player but i am finding it hard to install. I’m no flash wizz and this is hard for me. I went with the mp3 but i wanted to congratulate you for this effort.

      Best regards,
      Chris Young

    Leave a comment