ClientApi

Represents browser API for Gallery IPX.

The API is available on any page that runs one or more Brightcove embedded experiences. It is designed to help 3rd parties with Brightcove experiences integration. Provides access to current player, videos and state information as well as listeners for playback-related events.

Before accessing the Client API, you will need to get the correct embedded IPX on the page. They can be accessed by the id of the

element you used when you embedded it by running:

window.top.bcov.gal.getEmbed(bc-embed-exp_id),clientApi where exp_id is the experience id.

You can also get an object with all IPX available on a page by running window.top.bcov.gal.getEmbeds().

ClientApi

Methods

clientApi.getAllVideos() → {Array.ClientApi~Video}

Returns current list of all videos, available for the current state
Returns:
Array.ClientApi~Video - Array of Video Metadata objects

clientApi.getCurrentState() → {string}

Returns current state of the IPX
Returns:
string - State name, for example 'before' or 'after' for Live Event IPX

clientApi.getCurrentVideo() → {ClientApi~Video}

Returns currently playing video or the last video that was played
Returns:
ClientApi~Video - Video Metadata object

clientApi.off(Name, callback)

Removes the specified listener callback from the listener array for the event named eventName.
Parameters:
Name Type Description
Name string of the event.
callback function

clientApi.on(Name, callback)

Allows to register a callback for an embedded experience event.
Parameters:
Name Type Description
Name string of the event.
callback function

clientApi.once(Name, callback)

Allows to register a one-time callback function for the event named eventName. The next time eventName is triggered, this callback is removed and then invoked.
Parameters:
Name Type Description
Name string of the event.
callback function

Type Definitions

InteractivityEvent

Describes current status of an interactivity event. Includes information about the interactivity as well as it's position in the video
Properties:
Name Type Description
element string type of the interaction. For example, 'link', 'card', 'html', 'image'
linkText string link text if applicable
linkUrl string link URL if applicable
videoId number current video id
videoTitle string current video title
videoTime number playback position for the current video

Player

See Player Documentation for more information about the Player object.

Video

See [Video Metadata Information] https://support.brightcove.com/video-metadata-mediainfo for more information about the video format. for detailed description

Events

interactionCardPanelClose

interactionCardPanelClose event. Emitted when user closed the interactivity information side panel.
Parameters:
Type Description
Array.<ClientApi~InteractivityEvent>

interactionCardPanelOpen

interactionCardPanelOpen event. Emitted when user clicked on the interactivity information link. All active interactions become visible in the side panel.
Parameters:
Type Description
Array.<ClientApi~InteractivityEvent>

interactionClick

interactionClick event. Emitted when user has clicked on an interactivity element. This includes both video interactions as well as custom HTML and image links.
Parameters:
Type Description
ClientApi~InteractivityEvent

interactionEnd

interactionEnd event. Emitted when a video interactivity element, like card or a link disappears from the video.
Parameters:
Type Description
ClientApi~InteractivityEvent

interactionStart

interactionStart event. Emitted when a video interactivity element, like card or a link appears in the video.
Parameters:
Type Description
ClientApi~InteractivityEvent

playerChanged

playerChanged event. Emitted when a different player is going to be used for playback. Can be generated multiple times for experiences that have multiple players.
Parameters:
Type Description
ClientApi~Player

playerLoaded

playerLoaded event. Emitted when a player is loaded. Can be generated multiple times for experiences that have multiple players.
Parameters:
Type Description
ClientApi~Player

stateChanged

stateChanged event. Emitted when a state of the embed experience is changed, for example from "Pre-event" to "Live".
Parameters:
Name Type Description
state. string Currently supported states: before, during, after, playback.

videoChanged

videoChanged event. Emitted when current video has changed.
Parameters:
Type Description
ClientApi~Video

videoLoaded

videoLoaded event. Emitted when video is fully loaded and ready to play. Can be generated multiple times when user changes the video
Parameters:
Type Description
ClientApi~Video

videoPaused

videoPaused event. Emitted when a video playback is paused by user
Parameters:
Type Description
ClientApi~Video

videoStarted

videoStarted event. Emitted when a video playback is started by user
Parameters:
Type Description
ClientApi~Video