DOWNLOADS EXAMPLES SKINS DOCS SUPPORT
 
 

JavaScript Event Handlers

Event  handlers are functions within wimpy.js that are get "pinged" when certain events occur within the player.

By default all "handler" functions are disabled. To enable these functions, you'll have to set enableWimpyEvents to TRUE. This variable is located within wimpy.js, in the "Handler Functions" section.

Example

var enableWimpyEvents = true;

The handler functions within wimpy.js are set up so that you can add your own custom code within the function. And / or be aware of what is going on within the player.

 

handleWimpyInit()

This function (inside wimpy.js) is pinged once Wimpy has initialized and is ready to accept javascirpt interact.

Returns a boolean value of TRUE.

 

handleTrackStarted()

This function (inside wimpy.js) is pinged each time a track is started and allows you to include your own custom code to handle events.

Returns information about the track. See wimpy_getTrackInfo()

 

handleTrackDone()

This function (inside wimpy.js) is pinged each time a track has finished playing and allows you to include your own custom code to handle events.

Returns information about the track. See wimpy_getTrackInfo()

 

handleTrackStoppedManually()

This function gets pinged when the user clicks on the "stop" or "pause" button.
NOTE: Clicking the stop button rewinds the track to the beginning.
NOTE: To detect automatic stops, we recommend polling Wimpy via wimpy_getTrackInfo, Which returns information about the current time and the total time.

NOTE: This option has been available since version 6.0.22. Prior versions do not include this funcitonality.

 

handleLinkClick()

This function (inside wimpy.js) is pinged when ecomWindow is set to "javascript"

1. Data is available in the <comments> section of an XML playlist.
OR
2. Data is available within the "comments" section of the MP3 files ID3 tags.

Traditionally, the "comments"area is reserved for a URL and used to link out to another page. However, when the ecomWindow configuration option is set to "javascript" the data within the comments area is directed to wimpy.js. This means that you can use the "comments" section of either the XML or the ID3 tag to store data, which can then be interpreted by Javascript.

NOTE: This option has been available since version 6.0.23. Prior versions do not include this funcitonality.

 

 

 

 

 

 

  ©Copyright Plaino LLC. All rights reserved.