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().
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
-
-
Returns currently playing video or the last video that was played
-
-
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
|
|
-
-
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
-
-
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 |
-
-
-
-
Events
-
-
interactionCardPanelClose event. Emitted when user closed the interactivity information side panel.
-
-
interactionCardPanelOpen event. Emitted when user clicked on the interactivity information link.
All active interactions become visible in the side panel.
-
-
interactionClick event. Emitted when user has clicked on an interactivity element.
This includes both video interactions as well as custom HTML and image links.
-
-
interactionEnd event. Emitted when a video interactivity element, like card or a link disappears from the video.
-
-
interactionStart event. Emitted when a video interactivity element, like card or a link appears in the video.
-
-
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.
-
-
playerLoaded event. Emitted when a player is loaded.
Can be generated multiple times for experiences that have multiple players.
-
-
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 event. Emitted when current video has changed.
-
-
videoLoaded event. Emitted when video is fully loaded and ready to play.
Can be generated multiple times when user changes the video
-
-
videoPaused event. Emitted when a video playback is paused by user
-
-
videoStarted event. Emitted when a video playback is started by user
-
-
videoEnded event. Emitted when a video playback has ended