Skip to content

Latest commit

 

History

History
349 lines (228 loc) · 11.4 KB

README.md

File metadata and controls

349 lines (228 loc) · 11.4 KB

@vbrick/rev-sdk

@vbrick/rev-sdk

A javascript SDK for embedding or calling rev APIs

Table of contents

Enumerations

Interfaces

Type Aliases

Variables

Functions

Type Aliases

IListener

Ƭ IListener<TEvent>: TVbrickMessages[TEvent] extends void ? () => void : (data: TVbrickMessages[TEvent]) => void

Event callback parameters for the specified event

Type parameters

Name Type
TEvent extends string & keyof TVbrickMessages

Defined in

embed/IVbrickEvents.ts:115


IWebcastStatusMessage

Ƭ IWebcastStatusMessage<T>: Object

Event indicating the current webcast status

Type parameters

Name Type
T extends WebcastStatus = WebcastStatus

Type declaration

Name Type
isPreProduction? boolean
status T

Defined in

embed/IVbrickTypes.ts:56


TEmbedMessages

Ƭ TEmbedMessages: Object

Authentication/load events

Type declaration

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

Defined in

embed/IVbrickEvents.ts:8


TPlayerMessages

Ƭ TPlayerMessages: Object

Video Player events

Type declaration

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

Defined in

embed/IVbrickEvents.ts:32


TPollId

Ƭ TPollId: Object

The Webcast Poll that has been Closed/Unpublished

Type declaration

Name Type
pollId string

Defined in

embed/IVbrickTypes.ts:116


TVbrickEvent

Ƭ TVbrickEvent: Extract<keyof TVbrickMessages, string>

Events emitted by Vbrick Embed

Defined in

embed/IVbrickEvents.ts:109


TVbrickMessages

Ƭ TVbrickMessages: TEmbedMessages & TPlayerMessages & TWebcastMessages & TPlaylistMessages

All supported events and their corresponding listener callback payload

Defined in

embed/IVbrickEvents.ts:103


TWebcastMessages

Ƭ TWebcastMessages: Object

Webcast events

Type declaration

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)

Defined in

embed/IVbrickEvents.ts:58

Variables

default

Const default: Object

Type declaration

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

Defined in

index.ts:18

Functions

embedPlaylist

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
});

Parameters

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

Returns

IVbrickPlaylistEmbed

An IVbrickPlaylistEmbed object

Defined in

embed/index.ts:90


embedVideo

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.

Parameters

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

Returns

IVbrickVideoEmbed

An IVbrickVideoEmbed object

Defined in

embed/index.ts:20


embedWebcast

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
});

Parameters

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

Returns

IVbrickWebcastEmbed

An IVbrickWebcastEmbed object

Defined in

embed/index.ts:55