EP_getTrackData
EP_isLoaded(player);
Returns true if the player is loaded and ready.
parameters:
player: the id of the player as string
example:
if(EP_isLoaded('ep_player1')) {
// do something
};
EP_play(player);
Tells the player to play.
parameters:
player: the id of the player as string
example:
EP_play('ep_player1');
EP_pause(player);
Tells the player to pause.
parameters:
player: the id of the player as string
example:
EP_pause('ep_player1');
EP_stop(player);
Tells the player to stop.
parameters:
player: the id of the player as string
example:
EP_stop('ep_player1');
EP_playPause(player);
Tells the player to toggle between play and pause.
parameters:
player: the id of the player as string
example:
EP_playPause('ep_player1');
EP_prev(player);
Tells the player to play the previous track in the playlist.
parameters:
player: the id of the player as string
example:
EP_prev('ep_player1');
EP_next(player);
Tells the player to play the next track in the playlist.
parameters:
player: the id of the player as string
example:
EP_next('ep_player1');
EP_setShuffle(player, shuffle);
Sets the shuffle mode.
parameters:
player: the id of the player as string
shuffle: true / false
example:
EP_setShuffle('ep_player1', true);
EP_setRepeat(player, repeat);
Sets the repeat mode.
parameters:
player: the id of the player as string
repeat: true / false
example:
EP_setRepeat('ep_player1', true);
EP_setAutoPlay(player, autoplay);
Sets the auto play mode.
parameters:
player: the id of the player as string
autoplay: true / false
example:
EP_setAutoPlay('ep_player1', true);
EP_playTrack(player, track);
Tells the player to play a specific track from the playlist.
parameters:
player: the id of the player as string
track: the index of the track in the playlist as integer
example:
EP_playTrack('ep_player1', 3);
EP_setVolume(player, volume);
Sets the volume of the player.
parameters:
player: the id of the player as string
volume: the volume as integer (0..100)
example:
EP_setVolume('ep_player1', 75);
EP_loadPlaylist(player, file);
Tells the player to load a new playlist file.
parameters:
player: the id of the player as string
file: the path and filename of the playlist file
example:
EP_loadPlaylist('ep_player1', 'playlist.xml');
EP_clearPlaylist(player);
Removes all tracks from the playlist.
parameters:
player: the id of the player as string
example:
EP_clearPlaylist('ep_player1');
EP_setPlaylist(player, xml, play);
Replaces the current playlist with the playlist that is given as XML string.
parameters:
player: the id of the player as string
xml: playlist XML as string
play: tells the player to start playing or not
example:
var playlist = '';
playlist += '<track><location>track1.mp3</location><creator>E-Phonic</creator><title>Track 1</title></track>';
playlist += '<track><location>track2.mp3</location><creator>E-Phonic</creator><title>Track 2</title></track>';
EP_setPlaylist('ep_player1', playlist, true);
EP_addTracks(player, xml, index);
Adds tracks to a specific index in the playlist.
parameters:
player: the id of the player as string
xml: playlist XML as string
index: the index in the playlist where the new tracks should be inserted
example:
var playlist = '';
playlist += '<track><location>track1.mp3</location><creator>E-Phonic</creator><title>Track 1</title></track>';
playlist += '<track><location>track2.mp3</location><creator>E-Phonic</creator><title>Track 2</title></track>';
EP_addTracks('ep_player1', playlist, 2);
EP_removeTracks(player, indexes);
Removes tracks from the playlist.
parameters:
player: the id of the player as string
indexes the indexes of the tracks to be removed as array
example:
EP_removeTracks('ep_player1', [0, 2, 6]);
EP_getCurrentTrackData(player);
Returns an object containing the playlist data of the current track
parameters:
player: the id of the player as string
example:
var track = EP_getCurrentTrackData('ep_player1');
alert(track.creator);
alert(track.title);
EP_getTrackData(player, index);
Returns an object containing the playlist data of the specified track
parameters:
player: the id of the player as string
index: the index in the track in the playlist
example:
var track = EP_getTrackData('ep_player1', 3);
alert(track.creator);
alert(track.title);
Player event callback functions
You can use these functions to be notified when certain events happen in the player.
All you need to do is add the javascript functions to your HTML and the player will call them on the right events.
The functions are optional and will only be called if they exist.
The id of the player will be passed as parameter with every call.