Well, what you need to do is possible with EE, but it need a few step to be set up.
I’ll try to describe a quick example.
First of all create a custom weblog named “tracks”, which will store all the tracks informations. You may create a few custom fields to add all the data you need (ie: author, track title, length, file…).
Here’s what I suggest :
- {title} for track title
- {track_author} for artist name
- {track_file} for MP3 file
- {track_album} for album name
If you want to do something usable, you may buy MCFileManager, a great plugin for TinyMCE (about 75$) or simply use EE built-in upload functionnality.
Then you must set up your templates : create a template group called “player”, then change the default “index” template type to “XML” (instead of web page).
In your “index” template, put some code like that :
<tracks>
{exp:weblog:entries weblog="tracks"}
<item id="{count}" author="{track_author}" album="{track_album}" title="{title}" file="{track_file}" />
{/exp:weblog:entries}
</tracks>
It will generate a XML track listing with all of your tracks.
The third step is to integrate your player to your webpage. Edit your webpage template and put the following code where you need to display the player :
<div id="myplayer"></div>
[removed]
var flashvars = {xmlURL:"{path=player/index}};
var params = {menu: "false"};
var attributes = {id: "myplayer_id"};
swfobject.embedSWF("/flash/player.swf", "myplayer", "200", "50", "8", "/flash/expressInstall.swf", flashvars, params, attributes);
[removed]
This part of code is assuming that :
- You use SWFObject to load your flash
- Your player is located id the /flash folder and named player.swf
- Its width is 200 pixels and its height is 50 pixels.
- The flashvars to tell the player which XML file to use is named “xmlURL”.
Of course you’ll need to adapt this code to your player specification (ie: change flashvars name if needed, change path…).
That’s all your flash MP3 player is now loading its data from an XML file built by EE.
You may then add more functionnality like building playlists. For that here’s two hints :
- Create a new weblog “playlist”, which store playlist data. Add a custom field to the “tracks” weblog which type is “related entry”, to link it with the “playlist” weblog.
Then use the reverse_related_entries tag to generate your XML playlist.
- Another trick is to use the great Solspace tag module to tag all your tracks.
Then all you need is to couple the tag module with your templates to generate on-the-fly playlists based on tag.
Hope this will help 