@vbrick/rev-sdk
A javascript SDK for embedding or calling rev APIs
- IBasicInfo
- IComment
- IPlaylistInfo
- IPlaylistItem
- IPoll
- ISlideEvent
- ISubtitles
- IVbrickBaseEmbed
- IVbrickPlaylistEmbed
- IVbrickVideoEmbed
- IVbrickWebcastEmbed
- IVideoInfo
- IWebcastInfo
- IWebcastLayout
- VbrickBaseEmbedConfig
- VbrickEmbedConfig
- VbrickPlaylistEmbedConfig
- VbrickSDKConfig
- VbrickSDKToken
- VbrickVideoEmbedConfig
- VbrickWebcastEmbedConfig
- IListener
- IWebcastStatusMessage
- TEmbedMessages
- TPlayerMessages
- TPollId
- TVbrickEvent
- TVbrickMessages
- TWebcastMessages
Ƭ IListener<TEvent
>: TVbrickMessages
[TEvent
] extends void
? () => void
: (data
: TVbrickMessages
[TEvent
]) => void
Event callback parameters for the specified event
Name | Type |
---|---|
TEvent |
extends string & keyof TVbrickMessages |
Ƭ IWebcastStatusMessage<T
>: Object
Event indicating the current webcast status
Name | Type |
---|---|
T |
extends WebcastStatus = WebcastStatus |
Name | Type |
---|---|
isPreProduction? |
boolean |
status |
T |
Ƭ TEmbedMessages: Object
Authentication/load events
Name | Type | Description |
---|---|---|
authChanged |
void |
Authentication has been updated |
error |
{ msg : string } |
Returned if an error occurs in the communication with the embed * (for example, a bad token)* |
error.msg |
string |
Diagnostic error message |
load |
void |
Fired on initial embed load |
playerStatusChanged |
{ status : PlayerStatus } |
Fired when the player has changed state (Play/Pause/Buffering, etc.) |
playerStatusChanged.status |
PlayerStatus |
- |
subtitlesChanged |
ISubtitles |
Fired when subtitles are changed or enabled/disabled |
videoLoaded |
IVideoInfo |
Passes metadata of video |
volumeChanged |
number |
Fired when the player's volume is updated |
Ƭ TPlayerMessages: Object
Video Player events
Name | Type | Description |
---|---|---|
currentTime |
{ currentTime : number ; duration : number } |
- |
currentTime.currentTime |
number |
Current time in seconds into the video |
currentTime.duration |
number |
Total duration of video |
playbackSpeedChanged |
number |
Fired when the playback rate has been updated |
seeked |
{ endTime : number ; startTime : number } |
Playback position has been changed |
seeked.endTime |
number |
Playback position when seek ended |
seeked.startTime |
number |
Playback position before seek started |
Ƭ TPollId: Object
The Webcast Poll that has been Closed/Unpublished
Name | Type |
---|---|
pollId |
string |
Ƭ TVbrickEvent: Extract
<keyof TVbrickMessages
, string
>
Events emitted by Vbrick Embed
Ƭ TVbrickMessages: TEmbedMessages
& TPlayerMessages
& TWebcastMessages
& TPlaylistMessages
All supported events and their corresponding listener callback payload
Ƭ TWebcastMessages: Object
Webcast events
Name | Type | Description |
---|---|---|
broadcastStarted |
IWebcastStatusMessage |
Webcast is active and video content displayed |
broadcastStopped |
IWebcastStatusMessage |
Webcast is active but video stopped |
commentAdded |
IComment |
New Chat comment added |
layoutChanged |
IWebcastLayout |
video/slides display has been changed |
pollClosed |
TPollId |
Includes the ID of a poll that is now closed |
pollOpened |
IPoll |
Poll has been opened |
pollPublished |
IPoll |
Poll is published - includes voting details |
pollUnpublished |
TPollId |
Poll has been removed |
slideChanged |
ISlideEvent |
Active slide has een updated |
webcastEnded |
IWebcastStatusMessage |
Webcast is complete |
webcastLoaded |
IWebcastInfo & IWebcastStatusMessage |
Passes metadata about the webcast |
webcastStarted |
IWebcastStatusMessage |
Webcast is active (video not yet visible / in lobby) |
• Const
default: Object
Name | Type |
---|---|
PlayerStatus |
typeof PlayerStatus |
PlaylistLayout |
typeof PlaylistLayout |
TokenType |
typeof TokenType |
WebcastStatus |
typeof WebcastStatus |
embedPlaylist |
(element : string | HTMLElement , playlistId : string , config : VbrickPlaylistEmbedConfig ) => IVbrickPlaylistEmbed |
embedVideo |
(element : string | HTMLElement , videoId : string , config : VbrickVideoEmbedConfig ) => IVbrickVideoEmbed |
embedWebcast |
(element : string | HTMLElement , webcastId : string , config : VbrickWebcastEmbedConfig ) => IVbrickWebcastEmbed |
▸ embedPlaylist(element
, playlistId
, config
): IVbrickPlaylistEmbed
Embeds a playlist on the page
Example
Embedding a playlist:
//In HTML: <div id="playlist-embed"></div>
const playlistId = '0d252797-6db7-44dc-aced-25a6843d529c';
revSdk.embedPlaylist('#playlist-embed', playlistId, {
autoplay: true,
token
});
Name | Type | Description |
---|---|---|
element |
string | HTMLElement |
Either a CSS selector string or HTML Element where the embed content will be rendered |
playlistId |
string |
ID of the playlist to embed |
config |
VbrickPlaylistEmbedConfig |
A configuration object |
An IVbrickPlaylistEmbed object
▸ embedVideo(element
, videoId
, config
): IVbrickVideoEmbed
Embed a VOD/video on a page, with optional token-based authentication. Returns a VbrickEmbed object for interacting with playback and receiving events.
Name | Type | Description |
---|---|---|
element |
string | HTMLElement |
Container element where the embed content will be rendered. Either an HTMLElement or a CSS Selector string. |
videoId |
string |
ID of the video to embed |
config |
VbrickVideoEmbedConfig |
A configuration object |
An IVbrickVideoEmbed object
▸ embedWebcast(element
, webcastId
, config
): IVbrickWebcastEmbed
Embeds a webcast on the page
Example
Embedding a webcast:
//In HTML: <div id="webcast-embed"></div>
const webcastId = '0d252797-6db7-44dc-aced-25a6843d529c';
revSdk.embedWebcast('#webcast-embed', webcastId, {
showVideo: true,
token
});
Name | Type | Description |
---|---|---|
element |
string | HTMLElement |
Either a CSS selector string or HTML Element where the embed content will be rendered |
webcastId |
string |
ID of the webcast to embed |
config |
VbrickWebcastEmbedConfig |
A configuration object |
An IVbrickWebcastEmbed object