First, extract 'mp3player.zip' somewhere on your hard disk.
The contents of this zipfile is basically the default setup, so when you open the 'example_nobius.html' you will see a working example of the MP3 player.
If you upload all files to your website you should have the example working online already!
<script src="swfobject.js" type="text/javascript"></script>If you want to use the Javascript API to control the player you should also include the ep_player.js script:
<script src="ep_player.js" type="text/javascript"></script>In the body of the page we include the MP3 Player code:
<div id="flashcontent"> To use the <a href="http://www.e-phonic.com/mp3player/" target="_blank">E-Phonic MP3 Player</a> you will need <a href="http://www.adobe.com/products/flashplayer/" target="_blank">Adobe Flash Player 9</a> or better and a Javascript enabled browser. </div>Now we set the Flash Movie and its parameters.
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("ep_player.swf", "ep_player", "269", "226", "9", "#FFFFFF");
so.addVariable("skin", "skins/nobius_blue/skin.xml");
so.addVariable("playlist", "playlist.xml");
so.addVariable("autoplay", "false");
so.addVariable("shuffle", "false");
so.addVariable("buffertime", "1");
so.write("flashcontent");
// ]]>
</script>
To add your mp3 files, open 'playlist.xml' in a plain-text editor like Notepad.
You will see:
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns = "http://xspf.org/ns/0/">
<trackList>
<track>
<location>mp3/demo.mp3</location>
<title>MP3 Player!</title>
<creator>E-Phonic</creator>
</track>
</trackList>
</playlist>
To add your mp3-files just add a new track to the trackList node.
Please note that the 'location' value can be a relative path or a absolute path to the mp3-file like shown below.
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns = "http://xspf.org/ns/0/">
<trackList>
<track>
<location>mp3/demo.mp3</location>
<title>MP3 Player!</title>
<creator>E-Phonic</creator>
</track>
<track>
<location>mp3/mymp3.mp3</location>
<title>My song 1</title>
<creator>Me</creator>
</track>
<track>
<location>http://www.mywebsite.com/mp3files/mymp3.mp3</location>
<title>My song 2</title>
<creator>Me</creator>
</track>
</trackList>
</playlist>
Loading a single MP3 file
To load a single MP3 file, replace the 'playlist' parameter in your html with the 'file' parameter as shown below.
| playlist |
The playlist you want to load
so.addVariable("playlist", "playlist.xml");
|
| file |
The MP3 file, creator and title you want to load
so.addVariable("file", "<location>http://www.yourwebiste.com/song.mp3</location><creator>Song Creator</creator><title>Song Title</title>");
|
| playlistxml |
An xml string containing a playlist
so.addVariable("playlistxml", "<track><location>song.mp3</location><creator>Song Creator 1</creator><title>Song Title 1</title></track><track><location>song.mp3</location><creator>Song Creator 2</creator><title>Song Title 2</title></track>");
|
| autoplay |
Start playing on load (true or false)
so.addVariable("autoplay", "false");
|
| shuffle |
Shuffle playlist (true or false)
so.addVariable("shuffle", "false");
|
| repeat |
Repeat playlist (true or false)
so.addVariable("repeat", "false");
|
| buffertime |
The time to preload a MP3 file before it starts playing (time in seconds)
so.addVariable("buffertime", "1");
|
| volume |
The initial volume of the player.
so.addVariable("volume", "50");
|
| mute |
Tells the player to mute on load.
so.addVariable("mute", "false");
|
| key |
Your registration key
so.addVariable("key", "YOURREGKEY"); If you use more than one domain name, you can use multiple keys like this: so.addVariable("key", "YOURREGKEY1, YOURREGKEY2");
|
| notifyonevent |
Enables the player to call the 'EP_eventHandler' javascript function when the status of the player changes. (play, stop, pause, ...) The new event name will be passed as a string. See 'example_js_control.html' for an example implementation. so.addVariable("notifyonevent", "true");
|
<script src="ep_player.js" type="text/javascript"></script>For an example implementation, please check the example_js_control.html file that is included in the zip-file.
var so = new SWFObject("ep_player.swf", "ep_player", "269", "226", "9", "#FFFFFF");
|
EP_play("ep_player"); |
Starts playing the current MP3 file |
|
EP_pause("ep_player"); |
Pauses the current MP3 file |
|
EP_stop("ep_player"); |
Stops the current MP3 file |
|
EP_prev("ep_player"); |
Loads the previous track in the playlist. |
|
EP_next("ep_player"); |
Loads the next track in the playlist. |
|
EP_loadMP3("ep_player", "<location>http://www.yourwebiste.com/song.mp3</location><creator>Song Creator</creator><title>Song Title</title>"); |
Loads a new MP3 file. |
|
EP_loadPlayList("ep_player", "myplaylist.xml"); |
Loads a new playlist file. |
|
EP_playIndex("ep_player", 3); |
Loads a the specified item from the playlist. |
You can remove the E-Phonic icon and the 'unregistered' text from the MP3 Player by obtaining a registration key from the E-Phonic website for only €14.99.
The registration key will only work on your website.
Register your player now for only €14,99 per website!
After you register, you will receive your key on your PayPal email address.
To complete the registration, you'll have to add the key parameter to your SWFObject code in your html.
so.addVariable("key", "YOURUNIQUEKEY");
So you get:
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("ep_player.swf", "ep_player", "269", "226", "9", "#FFFFFF");
so.addVariable("skin", "skins/nobius_blue/skin.xml");
so.addVariable("playlist", "playlist.xml");
so.addVariable("autoplay", "false");
so.addVariable("shuffle", "false");
so.addVariable("buffertime", "1");
so.addVariable("key", "YOURUNIQUEKEY");
so.write("flashcontent");
// ]]>
</script>
To remove the E-Phonic icon from your interface, please remove the ephonic_icon tag from your skin.xml file.
<form name="aspnetForm" method="post" action="Default.aspx" id="aspnetForm"> <form></form> // FLASH PLAYER CODE </form>