PKL_GetInfo()

Description

Gets all of the current tracks metrics, including current time, loading status, and file data:

Example of the data returned:

onoff    : 1 // 0 off
playing  : 1 // 0 paused
loading  : 0 // 1 loading

Track Data
td_file  : path/to/track.mp3
td_title : Track Title
td_artist: Track Artist
td_image : path/to/poster.jpg

Playback Status
ps_remaining_nice: 0:24
ps_remaining   : 24.034
ps_current_nice: 0:47
ps_current     : 47.804
ps_duration_nice: 1:11
ps_duration    : 71.838
ps_percent     : 0.665441688242991
ps_status      : 0 // 0 paused, 1 playing
ps_init        : 1 // 1 player is ready for use, 0 player is not ready

Loading Status:
ls_percent : 1
ls_loaded  : 4723905
ls_total   : 4723905
ls_status  = 1 // 1 when loading, -1 when not loading, 0 when thinking about loading (or stalled)

Usage

PKL_GetInfo(PlayerID:String) :Object

Parameters

PlayerID:String - The name of the player you wish to control. If only one player is on the webpage, the PlayerID argument is not needed.

Returns

An Object

Example Code

If only one player exists on the page:

<script language="javascript">

var MyReturnedObject = PKL_GetInfo();

</script>

 

Multiple players require including "player" to specify which player

<script language="javascript">

var MyReturnedObject = PKL_GetInfo("MyPlayer1");

</script>

Displays the contents of the returned object

<script language="javascript">

var retval = "";
for(var prop in MyReturnedObject){
  retval += prop + " : " + MyReturnedObject[prop];
}
alert(retval);

</script>