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://axel.cfwebtools.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://axel.cfwebtools.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
- Things that i hope for
- to get the podcast version relased
- people will report bugs (the issues tab) on the google code site Google Code
- people will report features they want on the google code site Google Code
- Examples - Coming soon (hopefully people start to use it and email make me some tutorials)
- How to Skin the mp3 player
xml details (listed alphabetically)
- 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
Instructions
- 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"
- 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 http://blog.deconcept.com/swfobject/
- 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)
- 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)
- When you run the page, a default playlist will start playing if you have not provided one on the url
- (i.e.) http://yourdomain/whereyouputthefiles/index.cfm?playlist_url=data.xml
- please submit bugs to the google code site! I WILL FIX THEM I PROMISE! (the issues tab) Google Code
How could you embed this swf in an existing Flex project? If this isn't possible, what's the easiest way to add it using the source code?
Thanks!
yes, you can absolutely embed swfs into the flex project, you can use mx:SWFLoader i've never done it with this project, but i'll wee what i can do to show you how to do it... give me a couple of days to find a couple hours of free time to investigate... i can just add it to the example files i already have... great question!
thanks for reading!
VerifyError: Error #1053: Illegal override of _xmlPlayerSmall_mx_managers_SystemManager in _xmlPlayerSmall_mx_managers_SystemManager.
param count mismatch
virt params=1 optional=1 mx.managers::SystemManager/create()
over params=0 optional=0 mx.managers::SystemManager/create()
at global$init()
I'm not sure what any of it meant, so i put together an example app that i found on this link, to test out working with the SWFLoader itself and it all worked fantastically.
http://www.cflex.net/showfiledetails.cfm?ChannelID...
but it did not work out for my application unfortunately.
So my advice would be to look at the small version of the mp3 player, when you open the source it should be the file xmlPlayerSmall.mxml its very simple... you can customize the interface any way you wish, if you look at the big version and small version, you should be able to get some ideas.
If you'd like to take a look, I'm it using for my band's website at http://runawayfive.com, view source is enabled. Thanks again, this saved a ton of time!
<vp:LabelTicker width="200"
text="{mp3Player.currentTrackVO.title} - {mp3Player.currentTrackVO.artist} - {mp3Player.currentTrackVO.album}" textAlign="center" color="#000000"/>
Just change that to
<mx:Label width="200"
text="{mp3Player.currentTrackVO.title}" textAlign="center" color="#000000"/>
other than that, i'm glad it worked out for you.
;) thanks for using it!
thanks for the compliments on the mp3 player, i appreciate it.
I don't think i'm going to open source KTH... it is my experiment site for flex... when i learn things, i tend to try to use best practice... but it is learning, and when learning, you often don't know best practice... so the code for the site isn't very clean, so i wouldnt really open source it...
do you use coldfusion as a backend? do you have it installed locally?
if so, i could send you the code, i have an install script for it, and it's about a 10 step process of setting up the site... let me know if your interested, and i'll give you the code...
might take me a couple of day though to clean it up enough to send it to you.
Thanks
Thanks for reading the blog first of all, sorry for the late response.
Check out the new google code
http://code.google.com/p/xmlmp3player/
you should be able to grab the new zip file for the at the google code site.
http://axel.cfwebtools.com/Examples/xspfPlayer/bin...
Your flex mp3 player is just awesome. I'm a flex beginner and really want to build a personal site like yours (KillTheHeart.Com - nice domain name too :). I am wondering if i can have your website code for study purpose, if it's possible then please send to my email: thoihoado@gmail.com
Thanks again and keep up your great work
Way over a gig... 55GB actually.
Thanks for the comments.
Axel
http://feedogator.com/search_feeds.php?q=OPEN+SOUR...
Downloaded the source file. What files do I need / how do I compile the small version of the mp3 player ?
I already have adobe flex builder installed on my PC.
http://www.onlineflashgames.org
http://www.mmo-games.in
http://www.yourhumorpoint.com
http://benvarim.blogspot.com
Congratulations for this great piece of code!
I was wondering, is it possible to dynamically add a track to the player?
If possible, I'd like to send the command via javascript to the flash movie, so that it dynamically adds a track to the playlist. Is that possible, and if so how?
Thanks!
http://www.anarsist.org/
Kevin
http://www.twizl.com
I am pleased to see such high quality open source material.
james
http://www.nakliyatankara.com ankara nakliyat http://www.uluslararasi-nakliyat.org ankara evden eve nakliyat