Flash mp3 player is embedded in HTML page using the following code:
<embed src='MP3Player.swf?configURL=settings.xml' type='application/x-shockwave-flash' width='300' height='240' bgcolor='#FF5400' allowFullScreen='false'> </embed>
In the code:
- MP3Player.swf specifies name of SWF file of mp3 player;
- configURL parameter specifies relative to path to the XML file containing configurational settings;
- width specifies width in pixels of mp3 player;
- height specifies height in pixels of mp3 player;
- bgcolor specifies background color of the player.
All displaying settings and paths to .mp3 and pictures files are held in configurational XML file.
Description of configurational XML file
Below is the example XML file containing settings:
<?xml versione="1.0" encoding="utf-8"?> <config> <settings> <musicFolder>mp3/</musicFolder> <picturesFolder>pics/</picturesFolder> <showPlaylist>true</showPlaylist> <defaultCover> <show>true</show> <width>100</width> <imageURL>cover.jpg</imageURL> </defaultCover> <logo> <show>true</show> <imageURL>logo.png</imageURL> <href>http://www.flashdevs.com</href> </logo>
<button> <show>true</show> <text>album review</text> <href>http://www.flashdevs.com</href> </button> </settings> <song> <artist>Artist #1</artist> <title>Title #1</title> <length>253</length> <fileName>1.mp3</fileName> <cover>cover1.jpg</cover> </song> </config>
Node <settings></settings> contains instructions for player how to configure flash parts and how to display them.
Detailed description is below:
<musicFolder></musicFolder> - relative path to the folder containing .mp3 files;
<picturesFolder></picturesFolder> - relative path to the folder containing pictures such as your logo and albums covers;
<showPlaylist></showPlaylist> - indicates whether to display playlist or not.
In <defaultCover></defaultCover> node:
<show></show> - indicates whether to display albums covers or not, only two possible values: true, false;
<width></width> - maximum width in pixels of album covers;
<imageURL></imageURL> - path to the default album cover being loaded as player starts.
In <logo></logo> node:
<show></show> - indicates whether to show logo or not, only two possible values: true, false;
<imageURL></imageURL> - path to your logo picture;
<href></href> - link being associated with the logo when you press it.
In <button></button> node:
<show></show> - indicates whether to display the button with additional information or not, only two possible values: true, false;
<text></text> - text on the button;
<href></href> - link being associated with the button when you press it.
In <song></song> node:
<artist></artist> - name of the artist;
<title></title> - title of the track;
<length></length> - length of the track in seconds, fractional number is possible;
<fileName></fileName> - name of the .mp3 file;
<cover></cover> - name of the album cover picture, supported file formats are *.jpg, *.png and *.gif.
The number of <song></song> nodes corresponds to the number of songs in the playlist.

