Wimpy Player Event Listener Reference

 

The following events can be "listened" to using the "addListener" method.

Listener Name Pinged Returns
launch When a track is requested to load and play. Track Dataset 1
loadStart WWhen the track is "engaged" and begins loading, just prior to playing. (Since v7.4.36) Track Dataset 1
play When track starts to play. Track Dataset 1
pause When track is paused Track Dataset 1
done When track has finnished playing Track Dataset 1
skinReady When the skin is fully loaded and can be interacted with. none
enabled When player becomes the "live" player on the page. If there are multiple players on a single page, some of the players are disabled, and only one player can be enabeled and "live" at a time. none
disabled When player becomes disabled. none
playlistReady When a playlist is available (loaded and rendered) The playlist as a Javascript Array of Track Datasets 1
playlistComplete

Pinged after the last item in a playlist is finished playing. If playlist looping is enabled (and the auto advance option is enabled), the playlist will still wrap around and start playing the first item.

This option is useful for larger music collections where loading a masssive playlist is impractical. Leveraging this option will allow you to load smaller portions only as needed. Use the setPlaylist or appendPlaylist API method to load more tracks or replace the playlist.

 
link Pinged whenever a link icon in the playlist is clicked. This event is fired with or without an active linkHandler. (A linkHandler will block the default functionality.) Track Dataset. 1
download Pinged whenever a download icon in the playlist is clicked. This event is fired with or without an active downloadHandler. (A downloadHandler will block default functionality.) Track Dataset 1
resize Pinged whenever the player is resized. A player can be set up to automatically resize itself, so this listener allows you to be notified when the player's size changes without manually changing the size. Note that even when manually resizing this notification will still be sent. none
activity

There are 3 kinds of activity this listener returns:

-1 = no activity, nothing playing
0 = Loading initiated, but hasn't started playing yet (thinking)
1 = Player is playing.

integer
runtime

Continuously monitor the player recieving:

- player - (WimpyPlayer) The player that is dispatching the event.
- activity - (integer) If the player is actively playing anything (same as what the "activity" listener returns.
- playerState - (object) General inofrmation about the play time. Same data is returned as from getStatus()
- amScrubbing - (boolean) Inidcates that the user is actively moving the timeline (scrubber) control, which causes the playerState to show different readings, but no activity because the player gets paused during this operation.

Example usage:

myPlayer.addEventListener("runtime", monitor, this);
function monitor(player, activity, playerState, amScrubbing){
  // do your thing here.
}

(player, activity, playerState, amScrubbing)
clickPlay

Fired when a user clicks the play button

See example

object - player info 2
clickPause

Fired when a user clicks the play button

See example

object - player info 2
clickStop

Fired when a user clicks the stop button

See example

object - player info 2
clickNext

Fired when a user clicks the next button

See example

object - player info 2
clickRewind

Fired when a user clicks the rewind button

See example

object - player info 2
clickVolume

Fired when a user clicks the AAAAA button

See example

object - player info 2, second arg will be the volume in percentage
clickMute

Fired when a user clicks the mute button

See example

object - player info 2, second arg = going to state.
clickRandom

Fired when a user clicks the random button

See example

object - player info 2, second arg = going to state.
clickLoop

Fired when a user clicks the loop button

See example

object - player info 2, second arg = going to state.
clickFullscreen

Fired when a user clicks the fullscreen button

See example

object - player info 2
clickPlaylistBack

Fired when a user clicks the playlist "back" button

See example

object - player info 2
clickHelp

Fired when a user clicks the help button.

See example

object - player info 2

1. A Track Dataset ia and object containing current track info. The info is identical to the object returned by the getTrackDataset method.

2. An object with 2 properties
- "track" - containing info about the current track, such as artist, title.
- "state" - containing info about the current playback state, such as time.

state: {
	buffering: false
	current: 0.01
	current_nice: "0:00"
	duration: 33.04
	duration_nice: "0:33"
	init: 1
	percent: 0.0003026634382566586
	remaining: 33.03
	remaining_nice: "0:33"
	status: 1
}

track: {
	album: "The 11th Album"
	amPlaylist: 0
	artist: "Plain Vs Colt"
	date: "11/23/1996"
	file: "/wimpy/song11.mp3"
	i: 10
	image: "/wimpy/song11.jpg"
	other: "The experiment"
	price: "$0.99"
	title: " Song 11"
}