Path: rsConf.cb
The callback API can be used to trigger custom functions when certain pre-defined events occur. Inside the callback functions the context (the this keyword) is always set to the player element that triggered the event. Optionally, some events provide arguments as well.
Note: If you're using multiple callbacks, make sure you add them all to the same rsConf object.
Example:

window.rsConf = {
	cb: {
		ui: {
			open: function() {
				doSomething();
			}
		}
	}
};
  • audio.download

    Path: rsConf.cb.audio.download

    Default value: None

    Description: Fires when a user downloads an mp3 from the Download dialog. The "this" keyword will refer to the container of the currently active player.

  • audio.ended

    Path: rsConf.cb.audio.ended

    Default value: None

    Description: Fires when the player has finished the playback of an entire audio file. The "this" keyword will refer to the container of the currently active player.

  • audio.loaded

    Path: rsConf.cb.audio.loaded

    Default value: None

    Description: Fires after the audio have loaded enough to start the playback, just before the playback begins. The "this" keyword will refer to the container of the currently active player.

  • audio.loaderror

    Path: rsConf.cb.audio.loaderror

    Default value: None

    Description: Fires if the audio for some reason could not be loaded. The "this" keyword will refer to the container of the currently active player.

  • audio.nosound

    Path: rsConf.cb.audio.nosound

    Default value: None

    Description: Fires when the player for some reason doesn't succeed with playing the audio and instead has to display a link to the audio. The "this" keyword will refer to the container of the currently active player.

  • ui.beforeclose

    Path: rsConf.cb.ui.beforeclose

    Default value: None

    Description: Fires immediately after the user clicks on the close button in the player before any native close events have taken place. Note that opening a new player while the previous player is playing does not trigger this event, it only responds to direct user interaction. The "this" keyword will refer to the container element of the closed player.

  • ui.close

    Path: rsConf.cb.ui.close

    Default value: None

    Description: Fires when the user clicks on the close button in the player, and after all native close events have taken place. Note that opening a new player while the previous player is playing does not trigger this event, it only responds to direct user interaction. The "this" keyword will refer to the container element of the closed player.

  • ui.dialog.beforeopen

    Path: rsConf.cb.ui.dialog.beforeopen

    Default value: None

    Description: Fires before any dialog (Settings, Text Mode, Translation, Dictionary, Download mp3, Error) is populated and displayed on the screen. The "this" keyword will refer to the container of the currently active player, which in most cases is the starting point of opening a dialog.

  • ui.dialog.close

    Path: rsConf.cb.ui.dialog.close

    Default value: None

    Description: Fires after a dialog has been closed. The "this" keyword will refer to the container of the currently active player.

  • ui.dialog.open

    Path: rsConf.cb.ui.dialog.open

    Default value: None

    Description: Fires after a dialog have been displayed on the screen. The "this" keyword will refer to the container of the currently active player.

  • ui.open

    Path: rsConf.cb.ui.open

    Default value: None

    Description: This event fires when the user opens a player, which happens when the user clicks on a listen button, it always fires before rsConf.cb.ui.play. The "this" keyword will refer to the container element of the currently active player.

  • ui.pause

    Path: rsConf.cb.ui.pause

    Default value: None

    Description: Fires when the user clicks on the pause button. The "this" keyword will refer to the container element of the current player.

  • ui.play

    Path: rsConf.cb.ui.play

    Default value: None

    Description: Fires when the user clicks on a listen button, right after rsConf.cb.ui.open if the player was previously closed. Note that this event also fires when playback starts after the player has been paused or stopped. The "this" keyword will refer to the container element of the current player.

  • ui.popup.close

    Path: rsConf.cb.ui.popup.close

    Default value: None

    Description: Fires after the text-selection pop-up menu have been closed, either manually or by timeout. The “this” keyword will refer to the menu container element.

  • ui.popup.open

    Path: rsConf.cb.ui.popup.open

    Default value: None

    Description: Fires immediately after the text-selection pop-up menu has been displayed. The “this” keyword will refer to the menu container element.

  • ui.progresschanged

    Path: rsConf.cb.ui.progresschanged

    Default value: None

    Description: Fires when everytime the progressbar is updated, either because the audio is playing or because the user drag’n’dropped the playhead to a new position. The new value (in percent) is provided as the only parameter.

  • ui.settingsopened

    Path: rsConf.cb.ui.settingsopened

    Default value: None

    Description: Fires when the user clicks on the settings button. The "this" keyword will refer to the container element of the settings panel.

  • ui.stop

    Path: rsConf.cb.ui.stop

    Default value: hlon

    Description: Fires when the user clicks on the stop button. The "this" keyword will refer to the container element of the current player.

  • ui.timeupdated

    Path: rsConf.cb.ui.timeupdated

    Default value: None

    Description: Fires continuously during audio playback. The "this" keyword refers to the player’s container element.

  • ui.volumechanged

    Path: rsConf.cb.ui.volumechanged

    Default value: None

    Description: Fires when the user changes the volume.