“Easy Audio Player ” Documentation by FWDesign - v1.0


Easy Audio Player

Version: 3
By:© FWD (FUTURE WEB DESIGN)
Email: tibi_diablo@yahoo.com

Thank you for purchasing our script. If you have any questions that are beyond the scope of this help file, please feel free to email via our email. Thanks so much!


Table of Contents

  1. Important notes read this before anything else.
  2. Preparing the audio files.
  3. Preparing SHOUTCAST.
  4. How to install Easy Audio Player into your html page.
  5. Constructor parameters.
  6. Encrypt source path.
  7. API.
  8. Sources and Credits

A) Important notes make sure you read this! - top

Please note that the Easy Audio Player installation and configuration is not complicated but because it has a lot of customizable settings it might seem complicated, please go through the entire documentation before trying to install it into your own page. Basically what it must be done is to copy some html code from the examples we provided and paste it into your own html page and of course add your own audio file.

The server is character case sensitive so make sure that the Easy Audio Player settings are identical to those from the provided examples.

When testing local on IE7/IE8 it will not work because the flash (.swf) file is trying to comunicate with the browser and this is not allowed, of course it will work fine when tested online.

B) Preparing the audio files. - top

This audio player requires only .mp3, there is no need to suply an .ogg or other type of audio source.

C) Preparing SHOUTCAST. - top

In order to stream shoutcast instead on adding the source mp3 file path add the shoutcast server address and at the end of it ;.mp3 , like this : http://95.141.24.224:80/;.mp3. Adding the ;.mp3 at the end of the address will force the server to serve the mp3 stream instead of the http web page. Please note that this player has support only for mp3 stream and it will not work correctly with other formats like .acc or .ogg. The good news is that the player will play the stream on all browser no matter which operating system is used, this applies to both mobile and desktop.

D) How to install Easy Audio Player into your html page. - top

This is a small tutorial about how to install the Easy Audio Player into your page. Easy Audio Player can be e embedded into a html page inside a div of your choosing, the Easy Audio Player will adapt its width based on the maxWidth property specified in the constructor, the height is set based on the skin height, if the page is resized and the parent div width is smaller then the maxWidth property the Easy Audio Player will adapt its size accordingly.

In the download files inside the start folder there are html files starting with the label "skin", each of this examples have exactly the same structure with different constructor settings you can use one of them to copy and paste the needed html code based on skin that you need, I will use the skin-minimal-white.html as an example for this tutorial.

The skin is created using javascript and .png images, if you want a custom skin please contact us. If you want to create a skin of your own modify the ones we already provided.

This is how the player is installed in a HTML page, please read the Constructor parameters section to understand the Easy Audio Player properties

E) Constructor parameters. - top

Please open any of the .html files provided with a text editor as reference.

These parameters represents the possible setting for the Easy Audio Player they are all visible in the below image and described below.

		
//----main----// //-- visualizer --//

F) Encrypt source path. - top

To encrypt the source path I have created a tool that will encrypt the source path at this link, enter the source path (this applies all formats) in the input field then click on the Encrypt media button, once this is done copy the encrypted track path and paste it as the track source parameter.this is showed below. In this example content/mp3/01.mp3 is encrypted to encrypt:Y29udGVudC9tcDMvMDEubXAz .

G) API. - top

Inside the donwload files there is HTML file called API-example.html, in this file I have added all events and methods for reference, open the page source to see them.

API - public methods:

Function Method Description

setVolume

setVolume( Number ):void Set the audio volume, this method accepts a parameter that represents a number between 0 (audio mute state) and 1 (audio maximum volume).

startToScrub

startToScrub():void Notify EAP that the player is ready to scrubb.

stopToScrub

stopToScrub():void Notify EAP that the player scrubb is done.

scrub

scrub( Number ):void Notify instance to scrub (set the audio position), this method accepts a parameter that represents a number between 0 (audio start position) and 1 (audio end position).

stop

stop():void Stops the playback and the loading process if the loading process has started.

play

play():void Start / play playback.

pause

pause():void Pause the playback.

setSource

setSource(path:String):void Set a new mp3 source.

getSourcePath

getSourcePath():String:void Return source path.

getCurrentTime

getCurrentTime():String:void Return the current time.

getDuration

getDuration():String:void Return the duration.

API - event listeners:

Event Prefix Description

ready

FWDEAP.READY

Dispatched when the EAP instance API is actually available.

start

FWDEAP.START

Dispatched when the Mp3 playing has started.

error

FWDEAP.ERROR

Dispatched when the EAP instance can't load or play the audio file, this event has a property of type string that represents the error message.

stop

FWDEAP.STOP

Dispatched when the EAP instance is stopped.

play

FWDEAP.PLAY

Dispatched when the EAP instance playback start to play.

pause

FWDEAP.PAUSE

Dispatched when the EAP instance playback is paused.

update

FWDEAP.UPDATE

Dispatched when the EAP instance is playing and it's position is changing (useful to update a custom scrub bar), this event has a property of type number between 0 (audio start position) and 1 (audio end position).

updateTime

FWDEAP.UPDATE_TIME

Dispatched when the EAP instance current duration is changing. This event has two properties of type string curTime and totalTime.

playComplete

FWDEAP.PLAY_COMPLETE

Dispatched when the EAP instance playback has reached the end of the audio file.

H) Sources and Credits - top

This component was made by Tibi from FWD (FWDesign) FUTURE WEB DESIGN, for more information and support contact us at tibi_diablo@yahoo.com

Once again, thank you so much for purchasing this item. As I said at the beginning, I'd be glad to help you if you have any questions regarding this Easy Audio Player and I'll do my best to assist.

FWDesign

Go To Table of Contents