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 has loaded the graphic component responsible for 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> 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 Player 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.

<static> advReady

Fired when advertising data is available.
The following parameters are passed to the callback function:

  • Player instance.
  • the underlying adEvent fired.

<static> advStarted

Fired when advertising starts playing.
The following parameters are passed to the callback function:

  • Player instance.
  • the underlying adEvent fired.

<static> advProgress

Fired when the advertising playhead crosses first quartile, half, third quartile, or completes.
The following parameters are passed to the callback function:

  • Player instance.
  • the underlying adEvent fired.
  • the position of the ad playhead

<static> advCompleted

Fired when an advertising completes playing.
The following parameters are passed to the callback function:

  • Player instance.
  • the underlying adEvent fired.

<static> advAllCompleted

Fired when every advertising has finished playing playing.
The following parameters are passed to the callback function:

  • Player instance.
  • the underlying adEvent fired.

<static> advPaused

Fired when an advertising is paused.
The following parameters are passed to the callback function:

  • Player instance.
  • the underlying adEvent fired.

<static> advResumed

Fired when an advertising is resumed.
The following parameters are passed to the callback function:

  • Player instance.
  • the underlying adEvent fired.

<static> advSkipped

Fired when an advertising is skipped.
The following parameters are passed to the callback function:

  • Player instance.
  • the underlying adEvent fired.

<static> advClick

Fired when an advertising is clicked.
The following parameters are passed to the callback function:

  • Player instance.
  • the underlying adEvent fired.

<static> advImpression

Fired when the impression URL has been pinged.
The following parameters are passed to the callback function:

  • Player instance.
  • the underlying adEvent fired.

<static> advCompanions

Fired when companion advertising is displayed.
The following parameters are passed to the callback function:

  • Player instance.
  • the list of companion ads that may be reproduced depending on the size of companion containers.

<static> advError

Fired when an error is returned while loading or reproducing advertising.
The following parameters are passed to the callback function:

  • Player instance.
  • a string describing the error occurred.

<static> allFramesLoaded

Fired when all the frames of a Threesixty product view content are fully loaded.
The following parameters are passed to the callback function:

  • Player instance.

Available for 360° Product View only.


<static> rotationStop

Fired when the rotation of the 360° Product View view stops.
The following parameters are passed to the callback function:

  • Player instance.
  • The index of the frame drawn in the player

Available for 360° Product View only.


<static> rotationStart

Fired when the rotation of the 360° Product View starts.
The following parameters are passed to the callback function:

  • Player instance.
  • The index of the frame drawn in the player

Available for 360° Product View only.


<static> newHotspot

Fired when an hotspot is placed on the content.
Returned object is in the right format to be passed to the insert API (after missing fields are completed)
The following parameters are passed to the callback function:

  • Player instance.
  • Hotspot object just created (the template for this object is the same of example hotspot item in API/getAllHotspots).
    You must supply missing fields (or remove the labels if not desired) before trying to save this hotspot.

<static> hotspotEdited

Fired when an hotspot is edited.
Returned object is in the right format to be passed to the edit API.
The following parameters are passed to the callback function:

  • Player instance.
  • Hotspot object just edited (the template for this object is the same of example hotspot item in API/getAllHotspots)

<static> hotspotSelected

Fired when an hotspot is selected.
The following parameters are passed to the callback function:

  • Player instance.
  • Hotspot object just selected (the template for this object is the same of example hotspot item in API/getAllHotspots)

<static> hotspotModeChanged

Fired when an hotspot is selected.
The following parameters are passed to the callback function:

  • Player instance.
  • Hotspot object just selected

<static> audioTracksUpdated

Fired when the audio tracks are updated
The following parameters are passed to the callback function:

  • Player instance.
  • Audio tracks

Available for Live only.


<static> audioTrackSwitched

Fired when the audio track is switched
The following parameters are passed to the callback function:

  • Player instance.
  • Selected Audio track

Available for Live only.