Module: Events

This page provides a reference to all the available events fired by THRON Player.
Currently the following event triggers are supported:

  • playerinstance.on('eventname', function to call): Using an "on" listener will continually listen for a specific event.
  • playerinstance.off('eventname', function to call): To be used in order to stop listening for a specific event.

Example

var options = {
		clientId: "your clientId here",
		xcontentId: "an xcontentId here",
		sessId: "pkey or session token"
	};
var player = THRONContentExperience("elementId", options);
//On ready callback:
var onReady = function(){
		//Stop listening
		player.off("ready", onReady);
		console.log("Reproducer is ready");
}
//Listen ready event
player.on("ready", onReady);

<static> contentLoaded

Fired when the Player has received all the content information.
The following parameters are passed to the callback function:

  • Player instance;
  • Some content information: totalNumberOfElements, items, id, type, currentItem (only if content is a playlist).

<static> beforeInit

Fired before Player's initialization.
The following parameters are passed to the callback function:

  • Player instance

<static> paramsChanged

Fired when the embed parameters change by means of the "params" method.

Example
//Add a listener on the params method and print a message in console:
player.on("params", function(){console.log("params changed")});

<static> ready

Fired when the Player is ready to start content playback.
The following parameters are passed to the callback function:

  • Player instance;
  • Some content information: contentType, description, title, channels (an array of items containing all the available channels), promise (a jquery promise, resolved when all content information have arrived).

<static> error

Fired when an error occurs.
The following parameters are passed to the callback function:

  • Player instance

<static> destroyed

Fired after the Player has been destroyed.
The following parameters are passed to the callback function:

  • Player instance

<static> beforeFullscreen

Fired before the Player enters in fullscreen.
Not available on iOS devices.
The following parameters are passed to the callback function:

  • Player instance

<static> fullscreen

Fired when the Player enters in fullscreen.
The following parameters are passed to the callback function:

  • Player instance

<static> zoomIn

Fired when a "zoomIn" event is launched
The following parameters are passed to the callback function:

  • Player instance;
  • Zoom value (e.g.: 150%, 200%...).

Only for image, image playlists and document.


<static> zoomOut

Fired when a "zoomOut" event is launched
The following parameters are passed to the callback function:

  • Player instance;
  • Zoom value(e.g.: 150 % , 200 % ...).*

Only for image, image playlists and document.


<static> zoomReset

Fired when a "zoomReset" event is launched
The following parameters are passed to the callback function:

  • Player instance;
  • Zoom value(e.g.: 150 % , 200 % ...).

Only for image and image playlists.


<static> canPlay

Fired when a multimedia content is ready to be played.
The following parameters are passed to the callback function:

  • Player instance.

Only for video, video playlists, audio, audio playlists.


<static> complete

Fired when a multimedia content's playback has ended.
The following parameters are passed to the callback function:

  • Player instance.

Only for video, video playlists, audio, audio playlists.


<static> play

Fired when a multimedia content enters in play state.
The following parameters are passed to the callback function:

  • Player instance.

Only for video, video playlists, audio, audio playlists.


<static> pause

Fired when a multimedia content enters in pause state.
The following parameters are passed to the callback function:

  • Player instance.

Only for video, video playlists, audio, audio playlists.


<static> seeked

Fired when a seek action has been carried out.
The following parameters are passed to the callback function:

  • Player instance
  • Current time

Only for video, video playlists, audio, audio playlists.


<static> timeupdate

Fired when the currentTime attribute changes.
The following parameters are passed to the callback function:

  • Player instance;
  • Current time;
  • Duration.

Only for video, video playlists, audio, audio playlists.


<static> volumechange

Fired when the volume level changes.
The following parameters are passed to the callback function:

  • Player instance;
  • Volume value.

<static> speedchange

Fired when the video speed changes.
The following parameters are passed to the callback function:

  • Player instance;
  • Speed value.

Only for video and video playlists.


<static> playing

Fired when the content starts playback (either for the first time, after having been paused, or after restart).
The following parameters are passed to the callback function:

  • Player instance.

Only for video and video playlists.


<static> seek

Fired when a seek operation starts.
The following parameters are passed to the callback function:

  • Player instance.

Only for video and video playlists.


<static> levelChange

Fired when the selected quality level changes.
The following parameters are passed to the callback function:

  • Player instance;
  • Quality index.

Only for video and video playlists.


<static> levels

Fired when the list of available quality levels changes.
The following parameters are passed to the callback function:

  • Player instance;
  • List of all video qualities.

Only for video and video playlists.


<static> subtitleChange

Fired when the selected subtitle changes.
The following parameters are passed to the callback function:

  • Player instance;
  • Subtitle index.

Only for video and video playlists.


<static> subtitles

Fired when the list of available subtitles changes.
The following parameters are passed to the callback function:

  • Player instance;
  • List of all video subtitles.

Only for video and video playlists.


<static> subtitleDisable

Fired when the subtitles are disabled:

  • Player instance.

Only for video and video playlists.


<static> barHoverIn

Fired when the mouse enters over the control bar
The following parameters are passed to the callback function:

  • Player instance.

<static> barHoverOut

Fired when mouse exits the over on the control bar.
The following parameters are passed to the callback function:

  • Player instance.

<static> hoverIn

Fired when mouse enters into the HTML element of the Player.
The following parameters are passed to the callback function:

  • Player instance.

<static> hoverOut

Fired when mouse exits the HTML element of the Player.
The following parameters are passed to the callback function:

  • Player instance.

<static> tap

Fired when user taps the HTML element of the Player.
The following parameters are passed to the callback function:

  • Player instance.

<static> fullscreenTap

Fired when user taps the HTML element of the Player and the control bars are visible.
The Player will toggle fullscreen action.
The following parameters are passed to the callback function:

  • Player instance.

<static> fullscreenDoubleclick

Fired when user double clicks on the HTML element of the Player.
The following parameters are passed to the callback function:

  • Player instance.

<static> mouseMove

Fired when user moves the mouse into the HTML element of the Player.
The following parameters are passed to the callback function:

  • Player instance.

<static> orientationChange

Fired when device orientation changes.
The following parameters are passed to the callback function:

  • Player instance;
  • 0 for landscape orientation 90 for portrait.

Available on mobile devices only.


<static> resize

Fired when the Playe resizes its HTML Element.
The following parameters are passed to the callback function:

  • Player instance.

<static> keyPress

Fired when user presses any key.
The following parameters are passed to the callback function:

  • Player instance.

<static> simpleContentReady

Fired when a single content is ready to be reproduced.
The following parameters are passed to the callback function:

  • Player instance.

<static> galleryItemListReady

Fired each time a list of playlist elements is ready.
The following parameters are passed to the callback function:

  • Player instance.

<static> itemGalleryChanged

Fired when the playlist element being reproduced changes.
The following parameters are passed to the callback function:

  • Player instance;
  • Some content information: contentType, description, title, channels (an array of items containing all the available channels), promise (a jquery promise resolved when all content information have arrived).

<static> gallerySliderPageChanged

Fired when user clicks left or right playlist slider (the arrow to change the current element)
The following parameters are passed to the callback function:

  • Player instance.

<static> galleryItemListComplete

Fired when a new list of playlist elements has arrived.
The following parameters are passed to the callback function:

  • Player instance.

<static> linkedItemListReady

Fired when linked content are ready to be reproduced.
The following parameters are passed to the callback function:

  • Player instance.

<static> itemLinkedContentChanged

Fired when linked content being reproduced changes.
The following parameters are passed to the callback function:

  • Player instance;
  • Some content information: contentType, description, title, channels(an array of items containing all the available channels), promise(a jquery promise resolved when all content information have arrived).

<static> linkedContentItemListComplete

Fired each time a list of linked content is ready.


<static> linkedContentSliderPageChanged

Fired when user clicks left or right linked content slider.
The following parameters are passed to the callback function:

  • Player instance.

<static> downloadableItemListComplete

Fired each time a list of attachments is ready.
The following parameters are passed to the callback function:

  • Player instance.

<static> downloadableItemListReady

Fired when attachments are ready.
The following parameters are passed to the callback function:

  • Player instance.

<static> toogleShareOverlay

Fired when share overlay is shown/hidden.
The following parameters are passed to the callback function:

  • Player instance;
  • true if overlay is visible, false if hidden.

<static> documentReady

Fired when the document is fully rendered.
The following parameters are passed to the callback function:

  • Player instance.
  • number of pages
    Available for document only.

<static> documentPageChange

Fired when the document's current page changes
The following parameters are passed to the callback function:

  • Player instance.
  • number of new page
  • number of pages
    Available for document only.

<static> handCursorToolChange

Fired when Hand or Cursor tool changes
The following parameters are passed to the callback function:

  • Player instance.
  • Which tool is active. returns 0 if cursor tool is enabled, 1 if hand tool is enabled
    Available for document only.

<static> scaleChange

Fired when the document's scale changes
The following parameters are passed to the callback function:

  • Player instance.
  • an item with actual scale value, in string, and its equivalent value in number.
    Available for document only.