Skip to content

Vonage Video

github-actions edited this page Nov 12, 2024 · 62 revisions

Vonage VideoDocs


Documentation / Vonage Video

Vonage Video

Enumerations

ArchiveMode

Enum representing different archive modes.

Enumeration Members

Enumeration Member Value Description Defined in
ALWAYS "always" Archive mode set to 'always', where archives are continuously recorded. video/lib/types/ArchiveMode.ts:13
MANUAL "manual" Archive mode set to 'manual', where archives are started and stopped manually. video/lib/types/ArchiveMode.ts:8

ArchiveOutputMode

Enum representing different output modes for video archives.

Enumeration Members

Enumeration Member Value Description Defined in
COMPOSED "composed" Represents the composed output mode where all streams are mixed into one. video/lib/enums/ArchiveOutputMode.ts:8
INDIVIDUAL "individual" Represents the individual output mode where each stream is recorded separately. video/lib/enums/ArchiveOutputMode.ts:13

AudioRate

Enum representing different audio sample rates.

Enumeration Members

Enumeration Member Value Description Defined in
16KHZ 16000 Represents an audio sample rate of 16 kHz. video/lib/enums/AudioRate.ts:8
8KHZ 8000 Represents an audio sample rate of 8 kHz. video/lib/enums/AudioRate.ts:13

CaptionStatus

Enum representing different captioning status.

Enumeration Members

Enumeration Member Value Description Defined in
FAILED "failed" Indicates that captioning has failed. video/lib/enums/CaptionStatus.ts:23
PAUSED "paused" Indicates that captioning has been paused. video/lib/enums/CaptionStatus.ts:18
STARTED "started" Indicates that captioning has started. video/lib/enums/CaptionStatus.ts:8
STOPPED "stopped" Indicates that captioning has stopped. video/lib/enums/CaptionStatus.ts:13

ExperienceComposerResolution

Enum representing different resolutions for an experience composer.

Enumeration Members

Enumeration Member Value Description Defined in
HD_LANDSCAPE "1280x720" High definition landscape resolution. video/lib/enums/ExperienceComposerResolution.ts:20
HD_PORTRAIT "720x1280" High definition portrait resolution. video/lib/enums/ExperienceComposerResolution.ts:25
SD_LANDSCAPE "640x480" Standard definition landscape resolution. video/lib/enums/ExperienceComposerResolution.ts:10
SD_PORTRAIT "480x640" Standard definition portrait resolution. video/lib/enums/ExperienceComposerResolution.ts:15

LayoutType

Enum representing different layout types for live streaming broadcasts.

Enumeration Members

Enumeration Member Value Description Defined in
BEST_FIT "bestFit" Automatically determine the best fit layout. video/lib/enums/LayoutType.ts:8
CUSTOM "custom" Use a custom layout for the broadcast. video/lib/enums/LayoutType.ts:13
HORIZONTAL_PRESENTATION "horizontalPresentation" Horizontal presentation layout. video/lib/enums/LayoutType.ts:18
PIP "pip" Picture-in-picture (PIP) layout. video/lib/enums/LayoutType.ts:23
VERTICAL_PRESENTATION "verticalPresentation" Vertical presentation layout. video/lib/enums/LayoutType.ts:28

MediaMode

Enum representing media modes for a session.

Enumeration Members

Enumeration Member Value Description Defined in
RELAYED "enabled" Relayed mode where media is enabled. video/lib/enums/MediaMode.ts:13
ROUTED "disabled" Routed mode where media is disabled. video/lib/enums/MediaMode.ts:8

Resolution

Enum representing different video resolutions for live streaming broadcasts.

Enumeration Members

Enumeration Member Value Description Defined in
FHD_LANDSCAPE "1920x1080" Full HD landscape resolution (1920x1080 pixels). video/lib/enums/Resolution.ts:8
FHD_PORTRAIT "1080x1920" Full HD portrait resolution (1080x1920 pixels). video/lib/enums/Resolution.ts:13
HD_LANDSCAPE "1280x720" HD landscape resolution (1280x720 pixels). video/lib/enums/Resolution.ts:18
HD_PORTRAIT "720x1280" HD portrait resolution (720x1280 pixels). video/lib/enums/Resolution.ts:23
SD_LANDSCAPE "640x480" Standard definition landscape resolution (640x480 pixels). video/lib/enums/Resolution.ts:28
SD_PORTRAIT "480x640" Standard definition portrait resolution (480x640 pixels). video/lib/enums/Resolution.ts:33

StreamMode

Enum representing different stream modes for live streaming broadcasts.

Enumeration Members

Enumeration Member Value Description Defined in
AUTO "auto" Streams are selected automatically based on session rules. video/lib/enums/StreamMode.ts:8
MANUAL "manual" Streams are manually selected for inclusion in the broadcast. video/lib/enums/StreamMode.ts:13

Classes

Video

Video Client for managing and interacting with video-related operations in your application. This client allows you to control sessions, streams, archives, broadcasts, and various video-related features.

Usage:

  • Create and manage video sessions with customizable settings.
  • Control video streams, including muting, adding, and removing streams.
  • Initiate SIP calls and establish WebSockets for real-time communication.
  • Enable and disable captions for improved accessibility.
  • Start, stop, and manage video archives and broadcasts.
  • Render experiences and access detailed information about streams and archives.
  • Generate client tokens for secure session connections.
  • Perform various video-related operations with ease.

Remarks

The Video Client is designed to simplify video management tasks within your application. It provides a comprehensive set of methods and options to configure and control video interactions seamlessly.

Examples

Create a standalone Video client

import { Video } from '@vonage/video';

const videoClient = new Video({
 apiKey: VONAGE_API_KEY,
 apiSecret: VONAGE_API_SECRET
});

Create an Video client from the Vonage client

import { Vonage } from '@vonage/server-client';

const vonage = new Vonage({
  apiKey: VONAGE_API_KEY,
  apiSecret: VONAGE_API_SECRET
});

const videoClient = vonage.video;

Extends

Constructors

new Video()
new Video(credentials, options?): Video

Creates a new instance of the Client.

Parameters

credentials: AuthParams | AuthInterface

The authentication credentials or an authentication instance.

options?: ConfigParams

Optional configuration settings for the client.

Returns

Video

Inherited from

Client.constructor

Defined in

server-client/dist/lib/client.d.ts:35

Properties

auth
protected auth: AuthInterface;

The authentication instance responsible for generating authentication headers and query parameters.

Inherited from

Client.auth

Defined in

server-client/dist/lib/client.d.ts:24

authType
protected authType: AuthenticationType = AuthenticationType.JWT;

The type of authentication used for the client's requests.

Overrides

Client.authType

Defined in

video/lib/video.ts:85

config
protected config: ConfigParams;

Configuration settings for the client, including default hosts for various services and other request settings.

Inherited from

Client.config

Defined in

server-client/dist/lib/client.d.ts:28

transformers
static transformers: object;

Static property containing utility transformers.

camelCaseObjectKeys
camelCaseObjectKeys: PartialTransformFunction;
kebabCaseObjectKeys
kebabCaseObjectKeys: PartialTransformFunction;
omit()
omit: (keys, obj) => TransformedObject;
Parameters

keys: string[]

obj: ObjectToTransform

Returns

TransformedObject

snakeCaseObjectKeys
snakeCaseObjectKeys: PartialTransformFunction;
Inherited from

Client.transformers

Defined in

server-client/dist/lib/client.d.ts:11

Methods

addArchiveStream()
addArchiveStream(
   archiveId, 
   streamId, 
   audio?, 
video?): Promise<void>

Adds a stream to an existing archive, allowing you to include additional streams in the archive recording.

Parameters

archiveId: string

The ID of the archive to which you want to add a stream.

streamId: string

The ID of the stream you want to add to the archive.

audio?: boolean = true

Whether to include audio from the added stream (default: true).

video?: boolean = true

Whether to include video from the added stream (default: true).

Returns

Promise<void>

A promise that resolves when the stream has been successfully added to the archive.

Throws

If an error occurs while adding the stream to the archive.

Example
await videoClient.addArchiveStream(ARCHIVE_ID, STREAM_ID);
Defined in

video/lib/video.ts:102

addAuthenticationToRequest()
addAuthenticationToRequest(request): Promise<VetchOptions>

Adds the appropriate authentication headers or parameters to the request based on the authentication type.

Parameters

request: VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addAuthenticationToRequest

Defined in

server-client/dist/lib/client.d.ts:43

addBasicAuthToRequest()
protected addBasicAuthToRequest(request): Promise<VetchOptions>

Adds basic authentication headers to the request.

Parameters

request: VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addBasicAuthToRequest

Defined in

server-client/dist/lib/client.d.ts:71

addJWTToRequest()
protected addJWTToRequest(request): Promise<VetchOptions>

Adds a JWT to the request.

Parameters

request: VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addJWTToRequest

Defined in

server-client/dist/lib/client.d.ts:64

addQueryKeySecretToRequest()
protected addQueryKeySecretToRequest(request): Promise<VetchOptions>

Adds API key and secret to the request.

Parameters

request: VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addQueryKeySecretToRequest

Defined in

server-client/dist/lib/client.d.ts:57

addQueryKeySecretToRequestBody()
protected addQueryKeySecretToRequestBody(request): Promise<VetchOptions>

Adds API key and secret to the request body.

Parameters

request: VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addQueryKeySecretToRequestBody

Defined in

server-client/dist/lib/client.d.ts:50

addStreamToBroadcast()
addStreamToBroadcast(broadcastId, streamId): Promise<void>

Adds a stream to an existing broadcast, allowing you to include additional streams in the live broadcast.

Parameters

broadcastId: string

The ID of the broadcast to which you want to add a stream.

streamId: string

The ID of the stream you want to add to the broadcast.

Returns

Promise<void>

A promise that resolves when the stream has been successfully added to the broadcast.

Throws

If an error occurs while adding the stream to the broadcast.

Example
await videoClient.addStreamToBroadcast(BROADCAST_ID, STREAM_ID);
Defined in

video/lib/video.ts:133

connectToWebsocket()
connectToWebsocket(
   sessionId, 
   clientToken, 
config): Promise<WebSocketConnectResponse>

Connects to a WebSocket for a specified session using the provided client token and WebSocket configuration.

Parameters

sessionId: string

The ID of the session to which you want to connect via WebSocket.

clientToken: string

The client token generated for authentication.

config: WebSocketConfig

The WebSocket configuration specifying the URI and optional parameters.

Returns

Promise<WebSocketConnectResponse>

A promise that resolves with WebSocket connection details upon successful connection.

Throws

If an error occurs during the WebSocket connection process.

Example
const result = await videoClient.connectToWebsocket(
  SESSION_ID,
  CLIENT_TOKEN,
  {
    uri: 'wss://example.com',
  },
)

console.log(result.id);
Defined in

video/lib/video.ts:162

createSession()
createSession(sessionOptions?): Promise<Session>

Creates a new session with the specified options.

Parameters

sessionOptions?

Optional session configuration options.

sessionOptions.archiveMode?: ArchiveMode

The archive mode for the session.

sessionOptions.location?: string

The location for the session.

sessionOptions.mediaMode?: MediaMode

The media mode for the session.

Returns

Promise<Session>

A promise that resolves with details of the newly created session.

Throws

If an error occurs during the session creation process.

Examples

Create a session with default options

const session = await videoClient.createSession({});
console.log(session.sessionId);

Create a session with archive mode set to manual

import { ArchiveMode } from '@vonage/video';

const session = await videoClient.createSession({
  archiveMode: ArchiveMode.MANUAL,
});
console.log(session.sessionId);

Create a session with location set to a specific region

const session = await videoClient.createSession({
  location: 'eu',
});
console.log(session.sessionId);

Create a session with media mode set to routed

import { MediaMode } from '@vonage/video';

const session = await videoClient.createSession({
  mediaMode: MediaMode.ROUTED,
});
console.log(session.sessionId);
Defined in

video/lib/video.ts:228

deleteArchive()
deleteArchive(archiveId): Promise<void>

Deletes an archive with the specified archive ID.

Parameters

archiveId: string

The ID of the archive to delete.

Returns

Promise<void>

A promise that resolves when the archive is successfully deleted.

Throws

If an error occurs while deleting the archive or if the archive with the given ID does not exist.

Example
await videoClient.deleteArchive(ARCHIVE_ID);
Defined in

video/lib/video.ts:264

disableCaptions()
disableCaptions(captionId): Promise<void>

Disables captions for a specific caption ID.

Parameters

captionId: string

The ID of the caption to disable.

Returns

Promise<void>

A promise that resolves when the captions are successfully disabled.

Throws

If an error occurs while disabling captions or if the caption with the given ID does not exist.

Example
await videoClient.disableCaptions(CAPTION_ID);
Defined in

video/lib/video.ts:282

disableForceMute()
disableForceMute(sessionId, excludedStreamIds): Promise<ProjectDetailsResponse>

Disables force mute for a session, allowing audio for all streams.

Parameters

sessionId: string

The ID of the session for which to disable force mute.

excludedStreamIds: string[] = []

An optional array of stream IDs to exclude from the force mute operation.

Returns

Promise<ProjectDetailsResponse>

A promise that resolves when the force mute is successfully disabled for the session.

Throws

If an error occurs while disabling force mute or if the session with the given ID does not exist.

Example
const forceMute = await videoClient.disableForceMute(SESSION_ID);
console.log(forceMute.status);
Defined in

video/lib/video.ts:302

disconnectClient()
disconnectClient(sessionId, connectionId): Promise<void>

Disconnects a client from a session.

Parameters

sessionId: string

The ID of the session from which to disconnect the client.

connectionId: string

The ID of the client's connection to disconnect.

Returns

Promise<void>

A promise that resolves when the client is successfully disconnected from the session.

Throws

If an error occurs while disconnecting the client or if the session or connection with the given IDs do not exist.

Example
await videoClient.disconnectClient(SESSION_ID, CONNECTION_ID);
Defined in

video/lib/video.ts:322

disconnectWebsocket()
disconnectWebsocket(callId): Promise<void>

Disconnects a WebSocket connection associated with a call or session.

Parameters

callId: string

The ID of the call or session to which the WebSocket connection is associated.

Returns

Promise<void>

A promise that resolves when the WebSocket connection is successfully disconnected.

Throws

If an error occurs while disconnecting the WebSocket connection or if the call or session with the given ID does not exist.

Example
await videoClient.disconnectWebsocket(CALL_ID);
Defined in

video/lib/video.ts:343

enableCaptions()
enableCaptions(
   sessionId, 
   clientToken, 
captionOptions?): Promise<EnableCaptionResponse>

Enables captions for a session using the specified client token and caption options.

Parameters

sessionId: string

The ID of the session to enable captions for.

clientToken: string

The client token associated with the session, used for authentication.

captionOptions?: CaptionOptions = {}

Optional caption options to configure caption behavior.

Returns

Promise<EnableCaptionResponse>

A promise that resolves with an EnableCaptionResponse containing information about the enabled captions.

Throws

If an error occurs while enabling captions or if the session with the given ID does not exist.

Example
const result = await videoClient.enableCaptions(SESSION_ID, CLIENT_TOKEN);
console.log(result.captionId);
Defined in

video/lib/video.ts:364

forceMuteAll()
forceMuteAll(sessionId, excludedStreamIds?): Promise<ProjectDetailsResponse>

Forces muting of all streams in a session, except those specified in the excludedStreamIds array.

Parameters

sessionId: string

The ID of the session in which to force mute streams.

excludedStreamIds?: string[] = []

An optional array of stream IDs to exclude from muting.

Returns

Promise<ProjectDetailsResponse>

A promise that resolves with a ProjectDetailsResponse containing updated session details after muting.

Throws

If an error occurs while muting the streams or if the session with the given ID does not exist.

Example
const forceMute = await videoClient.forceMuteAll(SESSION_ID);
console.log(forceMute.status);
Defined in

video/lib/video.ts:395

generateClientToken()
generateClientToken(sessionId, tokenOptions?): string

Generates a client token for connecting to a session with the specified options.

Parameters

sessionId: string

The ID of the session to generate the client token for.

tokenOptions?: ClientTokenOptions

Optional token options including role, data, and expiration time.

Returns

string

A client token that can be used for authentication when connecting to a session.

Example
const token = videoClient.generateClientToken(SESSION_ID);
console.log(`The token is ${token}`);
Defined in

video/lib/video.ts:415

getArchive()
getArchive(archiveId): Promise<SingleArchiveResponse>

Retrieves information about a specific archive by its ID.

Parameters

archiveId: string

The ID of the archive to retrieve.

Returns

Promise<SingleArchiveResponse>

A promise that resolves to the details of the requested archive.

Example
const archive = await videoClient.getArchive(ARCHIVE_ID);
console.log(archive.createdAt);
Defined in

video/lib/video.ts:464

getBroadcast()
getBroadcast(broadcastId): Promise<BroadcastDetailsResponse>

Retrieves information about a specific broadcast by its ID.

Parameters

broadcastId: string

The ID of the broadcast to retrieve.

Returns

Promise<BroadcastDetailsResponse>

A promise that resolves to the details of the requested broadcast.

const broadcast = await videoClient.getBroadcast(BROADCAST_ID);
console.log(broadcast.createdAt);
Defined in

video/lib/video.ts:482

getCaptionStatus()
getCaptionStatus(captionId): Promise<CaptionStatusResponse>

Retrieves the status of a caption by its ID.

Parameters

captionId: string

The ID of the caption to retrieve the status for.

Returns

Promise<CaptionStatusResponse>

A promise that resolves to the status of the requested caption.

Example
const captionStatus = await videoClient.getCaptionStatus(CAPTION_ID);
console.log(captionStatus.status);
Defined in

video/lib/video.ts:503

getConfig()
getConfig(): ConfigParams
Returns

ConfigParams

Inherited from

Client.getConfig

Defined in

server-client/dist/lib/client.d.ts:36

getExperienceComposerRender()
getExperienceComposerRender(renderId): Promise<ExperienceComposerResponse>

Retrieves the details of an Experience Composer render by its ID.

Parameters

renderId: string

The ID of the Experience Composer render to retrieve.

Returns

Promise<ExperienceComposerResponse>

A promise that resolves to the details of the requested Experience Composer render.

Example
const render = await videoClient.getExperienceComposerRender(RENDER_ID);
console.log(render.createdAt);
Defined in

video/lib/video.ts:524

getStreamInfo()
getStreamInfo(sessionId, streamId?): Promise<SingleStreamLayoutResponse | MultiStreamLayoutResponse>

Retrieves information about one or more streams in a session.

Parameters

sessionId: string

The ID of the session to retrieve stream information from.

streamId?: string

Optional. The ID of a specific stream to retrieve information for.

Returns

Promise<SingleStreamLayoutResponse>

A promise that resolves to stream information. If a specific streamId is provided, it resolves to a single stream's information (SingleStreamLayoutResponse), otherwise, it resolves to multiple streams' information (MultiStreamLayoutResponse).

Example
const streamInfo = await videoClient.getStreamInfo(SESSION_ID);

if (streamInfo.items) {
  streamInfo.items.forEach((item) => {
    console.log(item.id);
  });
} else {
 console.log(streamInfo.id);
}
Defined in

video/lib/video.ts:553

intiateSIPCall()
intiateSIPCall(sessionId, options): Promise<SIPCallResponse>

Initiates a SIP call within a session.

Parameters

sessionId: string

The ID of the session in which to initiate the SIP call.

options: SIPCallOptions

The options for initiating the SIP call.

Returns

Promise<SIPCallResponse>

A promise that resolves to the SIP call response, including the call ID and other details.

Examples

Start a SIP call with default options

const sipCall = await videoClient.intiateSIPCall(SESSION_ID);
console.log(sipCall.id);

Start a SIP call with custom options

const sipCall = await videoClient.intiateSIPCall(
  SESSION_ID,
  {
    uri: 'sip://example.com',
  }
);
console.log(sipCall.id);
Defined in

video/lib/video.ts:611

listExperienceComposerRenders()
listExperienceComposerRenders(filter): Promise<MultiExperienceComposerResponse>

Lists Experience Composer renders based on the specified filter criteria.

Parameters

filter: ExperienceComposerListFilter

An optional filter to apply when listing Experience Composer renders.

Returns

Promise<MultiExperienceComposerResponse>

A promise that resolves to a list of Experience Composer renders matching the filter criteria.

Example
const renders = await videoClient.listExperienceComposerRenders();
for (const render of renders.items) {
  console.log(render.id);
}
Defined in

video/lib/video.ts:644

muteAllStreams()
protected muteAllStreams(
   sessionId, 
   active, 
excludedStreamIds): Promise<ProjectDetailsResponse>

Mutes or unmutes all streams in a session, optionally excluding specific stream IDs from muting.

Parameters

sessionId: string

The ID of the session in which to mute or unmute streams.

active: boolean

true to mute all streams, false to unmute all streams.

excludedStreamIds: string[] = []

An optional array of stream IDs to exclude from muting/unmuting.

Returns

Promise<ProjectDetailsResponse>

A promise that resolves to the updated session details.

Example
const forceMute = await videoClient.muteAll(SESSION_ID);
console.log(forceMute.status);
Defined in

video/lib/video.ts:668

muteStream()
muteStream(sessionId, streamId): Promise<ProjectDetailsResponse>

Mutes or unmutes a specific stream in a session.

Parameters

sessionId: string

The ID of the session containing the stream.

streamId: string

The ID of the stream to mute or unmute.

Returns

Promise<ProjectDetailsResponse>

A promise that resolves to the updated session details.

Example
const forceMute = await videoClient.muteStream(SESSION_ID, STREAM_ID);
console.log(forceMute.status);
Defined in

video/lib/video.ts:696

parseResponse()
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>

Parses the response based on its content type.

Type Parameters

T

The expected type of the parsed response data.

Parameters

request: VetchOptions

The request options.

response: Response

The raw response from the request.

Returns

Promise<VetchResponse<T>>

  • The parsed response.
Inherited from

Client.parseResponse

Defined in

server-client/dist/lib/client.d.ts:168

playDTMF()
playDTMF(
   sessionId, 
   digits, 
connectionId?): Promise<void>

Sends DTMF (Dual-Tone Multi-Frequency) tones to a specific session or connection.

Parameters

sessionId: string

The ID of the session to send DTMF tones to.

digits: string

The DTMF tones to play.

connectionId?: string

Optional. The ID of the connection within the session to send DTMF tones to.

Returns

Promise<void>

A promise that resolves when the DTMF tones have been played.

Example
await videoClient.playDTMF(SESSION_ID, '1234');
Defined in

video/lib/video.ts:719

prepareBody()
protected prepareBody(request): undefined | string

Prepares the body for the request based on the content type.

Parameters

request: VetchOptions

The request options.

Returns

undefined | string

  • The prepared request body as a string or undefined.
Inherited from

Client.prepareBody

Defined in

server-client/dist/lib/client.d.ts:158

prepareRequest()
protected prepareRequest(request): Promise<VetchOptions>

Prepares the request with necessary headers, authentication, and query parameters.

Parameters

request: VetchOptions

The initial request options.

Returns

Promise<VetchOptions>

  • The modified request options.
Inherited from

Client.prepareRequest

Defined in

server-client/dist/lib/client.d.ts:151

removeArchiveStream()
removeArchiveStream(archiveId, streamId): Promise<void>

Removes a stream from an archive.

Parameters

archiveId: string

The ID of the archive from which to remove the stream.

streamId: string

The ID of the stream to remove from the archive.

Returns

Promise<void>

A promise that resolves when the stream has been successfully removed from the archive.

Example
await videoClient.removeArchiveStream(ARCHIVE_ID, STREAM_ID);
Defined in

video/lib/video.ts:744

removeStreamFromBroadcast()
removeStreamFromBroadcast(broadcastId, streamId): Promise<void>

Removes a stream from a broadcast.

Parameters

broadcastId: string

The ID of the broadcast from which to remove the stream.

streamId: string

The ID of the stream to remove from the broadcast.

Returns

Promise<void>

A promise that resolves when the stream has been successfully removed from the broadcast.

Example
await videoClient.removeStreamFromBroadcast(BROADCAST_ID, STREAM_ID);
Defined in

video/lib/video.ts:766

searchArchives()
searchArchives(filter?): Promise<MultiArchiveResponse>

Searches for archives based on the specified filter criteria.

Parameters

filter?: ArchiveSearchFilter

Optional filter criteria to narrow down the search.

Returns

Promise<MultiArchiveResponse>

A promise that resolves with the search results, including multiple archive items.

Examples
const archives = await videoClient.searchArchives();
for (const archive of archives.items) {
  console.log(archive.id);
}

Search for archives for a session

const archives = await videoClient.searchArchives({
  sessionId: SESSION_ID,
});

for (const archive of archives.items) {
  console.log(archive.id);
}
Defined in

video/lib/video.ts:798

searchBroadcasts()
searchBroadcasts(filter?): Promise<MultiBroadcastResponse>

Searches for broadcasts based on the specified filter criteria.

Parameters

filter?: BroadcastSearchFilter

Optional filter criteria to narrow down the search.

Returns

Promise<MultiBroadcastResponse>

A promise that resolves with the search results, including multiple broadcast items.

Examples
const broadcasts = await videoClient.searchBroadcasts();
for (const broadcast of broadcasts.items) {
   console.log(broadcast.id);
}

Get braodcasts for a session

const broadcasts = await videoClient.searchBroadcasts({
  sessionId: SESSION_ID,
})
for (const broadcast of broadcasts.items) {
  console.log(broadcast.id);
 }
Defined in

video/lib/video.ts:833

sendDeleteRequest()
sendDeleteRequest<T>(url): Promise<VetchResponse<T>>

Sends a DELETE request to the specified URL.

Type Parameters

T

Parameters

url: string

The URL endpoint for the DELETE request.

Returns

Promise<VetchResponse<T>>

  • The response from the DELETE request.
Inherited from

Client.sendDeleteRequest

Defined in

server-client/dist/lib/client.d.ts:78

sendFormSubmitRequest()
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a POST request with form data to the specified URL.

Type Parameters

T

Parameters

url: string

The URL endpoint for the POST request.

payload?: Record<string, undefined | string>

Optional payload containing form data to send with the POST request.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendFormSubmitRequest

Defined in

server-client/dist/lib/client.d.ts:86

sendGetRequest()
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>

Sends a GET request to the specified URL with optional query parameters.

Type Parameters

T

Parameters

url: string

The URL endpoint for the GET request.

queryParams?

Optional query parameters to append to the URL. These should be compatible with Node's URLSearchParams.

Returns

Promise<VetchResponse<T>>

  • The response from the GET request.
Inherited from

Client.sendGetRequest

Defined in

server-client/dist/lib/client.d.ts:94

sendPatchRequest()
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a PATCH request to the specified URL with an optional payload.

Type Parameters

T

Parameters

url: string

The URL endpoint for the PATCH request.

payload?

Optional payload to be sent as the body of the PATCH request.

Returns

Promise<VetchResponse<T>>

  • The response from the PATCH request.
Inherited from

Client.sendPatchRequest

Defined in

server-client/dist/lib/client.d.ts:104

sendPostRequest()
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a POST request to the specified URL with an optional payload.

Type Parameters

T

Parameters

url: string

The URL endpoint for the POST request.

payload?

Optional payload to be sent as the body of the POST request.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendPostRequest

Defined in

server-client/dist/lib/client.d.ts:114

sendPutRequest()
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a PUT request to the specified URL with an optional payload.

Type Parameters

T

Parameters

url: string

The URL endpoint for the PUT request.

payload?

Optional payload to be sent as the body of the PUT request.

Returns

Promise<VetchResponse<T>>

  • The response from the PUT request.
Inherited from

Client.sendPutRequest

Defined in

server-client/dist/lib/client.d.ts:124

sendRequest()
sendRequest<T>(request): Promise<VetchResponse<T>>

Sends a request adding necessary headers, handling authentication, and parsing the response.

Type Parameters

T

Parameters

request: VetchOptions

The options defining the request, including URL, method, headers, and data.

Returns

Promise<VetchResponse<T>>

  • The parsed response from the request.
Inherited from

Client.sendRequest

Defined in

server-client/dist/lib/client.d.ts:144

sendRequestWithData()
sendRequestWithData<T>(
   method, 
   url, 
payload?): Promise<VetchResponse<T>>

Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.

Type Parameters

T

Parameters

method: POST | PUT | PATCH

The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).

url: string

The URL endpoint for the request.

payload?

Optional payload to be sent as the body of the request, JSON-encoded.

Returns

Promise<VetchResponse<T>>

  • The response from the request.
Inherited from

Client.sendRequestWithData

Defined in

server-client/dist/lib/client.d.ts:135

sendSignal()
sendSignal(
   signal, 
   sessionId, 
connectionId?): Promise<void>

Sends a signal to a session or a specific connection within a session.

Parameters

signal: Signal

The signal to send, including a type and data.

sessionId: string

The ID of the session to which the signal will be sent.

connectionId?: string

Optional. The ID of the connection within the session to which the signal will be sent. If not provided, the signal will be sent to the entire session.

Returns

Promise<void>

A promise that resolves when the signal is successfully sent.

Example
await videoClient.sendSignal(
  {
    type: 'text',
    data: 'Hello world!',
  },
  SESSION_ID,
);

###### Defined in

[video/lib/video.ts:861](https://github.com/Vonage/vonage-node-sdk/blob/998c56b0db7e5e7b374439c44b9eaae906276725/packages/video/lib/video.ts#L861)

##### setStreamClassLists()

```ts
setStreamClassLists(sessionId, settings): Promise<void>

Sets the stream class lists for one or more streams within a session.

Parameters

sessionId: string

The ID of the session for which stream class lists will be set.

settings: StreamClassList[]

An array of objects specifying the stream ID and corresponding class lists to be set.

Returns

Promise<void>

A promise that resolves when the stream class lists are successfully set.

Example
await videoClient.setStreamClassLists(
  SESSION_ID,
  [
    {
      id: STREAM_ID,
      layoutClassList: ['full'],
    }
  ]
)
Defined in

video/lib/video.ts:895

startArchive()
startArchive(sessionId, options?): Promise<SingleArchiveResponse>

Starts an archive for a given session with optional configuration.

Parameters

sessionId: string

The ID of the session to archive.

options?: ArchiveOptions

Optional configuration for the archive, such as audio/video settings, layout, and more.

Returns

Promise<SingleArchiveResponse>

A promise that resolves with information about the started archive.

Example
const archive = await videoClient.startArchive(SESSION_ID);
console.log(archive.id);
Defined in

video/lib/video.ts:918

startBroadcast()
startBroadcast(sessionId, config): Promise<BroadcastDetailsResponse>

Starts a broadcast for a given session with the specified configuration.

Parameters

sessionId: string

The ID of the session to start broadcasting.

config: BroadcastConfig

Configuration for the broadcast, including stream settings, layout, and more.

Returns

Promise<BroadcastDetailsResponse>

A promise that resolves with information about the started broadcast.

Example
const broadcast = await videoClient.startBroadcast(
  SESSION_ID,
  {
    outputs: {
      hls: {
        lowLatency: true,
      }
      rtmp: [{
        serverUrl: 'rtmp://example.com',
      }],
    }
  }
);
Defined in

video/lib/video.ts:955

startExperienceComposerRender()
startExperienceComposerRender(
   sessionId, 
   token, 
config): Promise<ExperienceComposerResponse>

Starts rendering an experience composer with the provided configuration.

Parameters

sessionId: string

The ID of the session associated with the experience composer.

token: string

The client token for authentication.

config: ExperienceComposerOptions

Configuration options for the experience composer rendering.

Returns

Promise<ExperienceComposerResponse>

A promise that resolves with information about the started experience composer rendering.

Example
const render = await videoClient.startExperienceComposerRender(
  SESSION_ID,
  token,
)

console.log(render.id);
Defined in

video/lib/video.ts:986

stopArchive()
stopArchive(archiveId): Promise<SingleArchiveResponse>

Stops an archive with the given archive ID.

Parameters

archiveId: string

The ID of the archive to stop.

Returns

Promise<SingleArchiveResponse>

A promise that resolves with information about the stopped archive.

Example
const archive = await videoClient.stopArchive(ARCHIVE_ID);

console.log(archive.status);
Defined in

video/lib/video.ts:1012

stopBroadcast()
stopBroadcast(broadcastId): Promise<BroadcastDetailsResponse>

Stops a broadcast with the given broadcast ID.

Parameters

broadcastId: string

The ID of the broadcast to stop.

Returns

Promise<BroadcastDetailsResponse>

A promise that resolves with information about the stopped broadcast.

Example
const broadcast = await videoClient.stopBroadcast(BROADCAST_ID);
console.log(broadcast.status);
Defined in

video/lib/video.ts:1031

stopExperienceComposerRender()
stopExperienceComposerRender(renderId): Promise<void>

Stops an Experience Composer render with the given render ID.

Parameters

renderId: string

The ID of the Experience Composer render to stop.

Returns

Promise<void>

A promise that resolves when the render is successfully stopped.

Example
await videoClient.stopExperienceComposerRender(RENDER_ID);
Defined in

video/lib/video.ts:1051

updateArchiveLayout()
updateArchiveLayout(archiveId, layout): Promise<void>

Updates the layout of an archive with the given archive ID.

Parameters

archiveId: string

The ID of the archive to update the layout for.

layout: ArchiveLayout

The new layout configuration to set for the archive.

Returns

Promise<void>

A promise that resolves when the layout is successfully updated.

Example
await videoClient.updateArchiveLayout(
Defined in

video/lib/video.ts:1069

updateBroadcast()
updateBroadcast(config): Promise<void>

Updates the configuration of a broadcast with the given broadcast ID.

Parameters

config: BroadcastUpdateConfig

The configuration options to update the broadcast.

Returns

Promise<void>

A promise that resolves when the broadcast is successfully updated.

Example
await videoClient.updateBroadcast({
  broadcastId: BROADCAST_ID,
  hasAudio: true,
})
Defined in

video/lib/video.ts:1094

Type Aliases

ArchiveLayout

type ArchiveLayout: object;

Represents the layout configuration for an archive.

Type declaration

screenshareType?
optional screenshareType: string;

Optional: The screenshare layout type to use when there is a screen-sharing stream in the archive (only applicable if type is 'bestFit' and screenshareType is set).

stylesheet?
optional stylesheet: string;

Optional: The stylesheet used for custom layout (only applicable if type is 'custom').

type
type: LayoutType;

The type of layout to be used for the archive.

Defined in

video/lib/types/ArchiveLayout.ts:6


ArchiveOptions

type ArchiveOptions: object;

Interface representing options for creating an archive.

Type declaration

hasAudio?
optional hasAudio: boolean;

Flag indicating whether audio should be included in the archive.

hasVideo?
optional hasVideo: boolean;

Flag indicating whether video should be included in the archive.

layout?
optional layout: ArchiveLayout;

Layout configuration for the archive.

name?
optional name: string;

Name of the archive.

outputMode?
optional outputMode: ArchiveOutputMode;

Output mode for the archive.

resolution?
optional resolution: Resolution;

Resolution for the archive.

streamMode?
optional streamMode: StreamMode;

Stream mode for the archive.

Defined in

video/lib/types/ArchiveOptions.ts:7


ArchiveSearchFilter

type ArchiveSearchFilter: object;

Interface representing filters for searching archives.

Type declaration

count?
optional count: number;

The number of archives to retrieve starting at the offset. Default is 50, with a maximum of 1000.

offset?
optional offset: number;

The start offset in the list of existing archives.

sessionId?
optional sessionId: string;

Retrieve archives for a specific session ID.

Defined in

video/lib/types/ArchiveSearchFilter.ts:4


BroadcastConfig

type BroadcastConfig: object;

Interface representing configuration options for a live streaming broadcast.

Type declaration

hasAudio?
optional hasAudio: boolean;

Whether the broadcast has audio.

hasVideo?
optional hasVideo: boolean;

Whether the broadcast has video.

layout?
optional layout: LayoutType;

The layout type for the broadcast.

maxBitrate?
optional maxBitrate: number;

The maximum bitrate for the stream.

maxDuration?
optional maxDuration: number;

The maximum duration for the broadcast, in seconds. The broadcast will automatically stop when the maximum duration is reached.

multiBroadcastTag?
optional multiBroadcastTag: string;

The unique tag for simultaneous broadcasts (if one was set).

outputs
outputs: BroadcastOutputs;

Configuration options for different types of broadcast streams (HLS and RTMP).

resolution?
optional resolution: Resolution;

The resolution of the broadcast.

streamMode?
optional streamMode: StreamMode;

The stream mode for the broadcast.

Defined in

video/lib/types/BroadcastConfig.ts:37


BroadcastDetailsResponse

type BroadcastDetailsResponse: object;

Represents the response containing details about a live streaming broadcast.

Type declaration

applicationId
applicationId: string;

The Vonage Application UUID.

broadcastUrls
broadcastUrls: object;

An object containing details about the HLS and RTMP broadcasts.

broadcastUrls.hls?
optional broadcastUrls.hls: string;

The URL for the HLS broadcast.

broadcastUrls.rtmp
broadcastUrls.rtmp: RTMPStream[];

An array of RTMP streams.

createdAt
createdAt: number;

The time the broadcast started, expressed in milliseconds since the Unix epoch (January 1, 1970, 00:00:00 UTC).

hasAudio
hasAudio: boolean;

Indicates whether the broadcast has audio.

hasVideo
hasVideo: boolean;

Indicates whether the broadcast has video.

id
id: string;

The unique ID for the broadcast.

maxBitrate?
optional maxBitrate: number;

The maximum bitrate for the stream.

maxDuration?
optional maxDuration: number;

The maximum duration for the broadcast (if one was set), in seconds.

multiBroadcasTag?
optional multiBroadcasTag: string;

The unique tag for simultaneous broadcasts (if one was set).

resolution?
optional resolution: Resolution;

The resolution of the broadcast, if set.

sessionId
sessionId: string;

The Vonage Video session ID associated with the broadcast.

settings?
optional settings: object;

An object containing settings for HLS.

settings.hls?
optional settings.hls: HlsSettings;

HLS settings.

streamMode
streamMode: StreamMode;

The stream mode for the broadcast.

updatedAt
updatedAt: number;

The timestamp when the broadcast was last updated, expressed in milliseconds since the Unix epoch.

Defined in

video/lib/types/Response/BroadcastDetailsResponse.ts:17


BroadcastOutputs

type BroadcastOutputs: object;

Interface representing configuration options for different types of broadcast streams (HLS and RTMP).

Type declaration

hls?
optional hls: HLSConfig;

Configuration options for HLS streaming.

rtmp
rtmp: RTMPStream[];

Configuration options for RTMP streaming.

Defined in

video/lib/types/BroadcastConfig.ts:22


BroadcastSearchFilter

type BroadcastSearchFilter: object;

Interface representing a filter for searching broadcasts.

Type declaration

count?
optional count: number;

The maximum number of items to return.

offset?
optional offset: number;

The offset for paginating the results.

sessionId?
optional sessionId: string;

The session ID to filter broadcasts by.

Defined in

video/lib/types/BroadcastSearchFilter.ts:4


BroadcastUpdateConfig

type BroadcastUpdateConfig: object;

Interface representing the configuration for updating a broadcast.

Type declaration

addStream?
optional addStream: string;

The ID of a stream to add to the broadcast.

broadcastId
broadcastId: string;

The ID of the broadcast to update.

hasAudio?
optional hasAudio: boolean;

Whether to include audio in the broadcast.

hasVideo?
optional hasVideo: boolean;

Whether to include video in the broadcast.

removeStream?
optional removeStream: string;

The ID of a stream to remove from the broadcast.

Defined in

video/lib/types/BroadcastUpdateConfig.ts:4


CaptionOptions

type CaptionOptions: object;

Interface representing options for captions.

Type declaration

languageCode?
optional languageCode: "en-us";

The language code for captions (e.g., "en-us").

maxDuration?
optional maxDuration: number;

The maximum duration for captions.

partialCaptions?
optional partialCaptions: "true" | "false";

Whether to generate partial captions.

statusCallbackUrl?
optional statusCallbackUrl: string;

The URL for the status callback of captions.

Defined in

video/lib/types/CaptionOptions.ts:4


CaptionStatusResponse

type CaptionStatusResponse: object;

Represents a response containing the status of captions for a live streaming broadcast.

Type declaration

applicationId
applicationId: string;

The Vonage Application UUID.

captionId
captionId: string;

The unique ID for the caption.

createdAt
createdAt: number;

The time when the caption was created, expressed in milliseconds since the Unix epoch (January 1, 1970, 00:00:00 UTC).

duration
duration: number;

The duration of the caption, in seconds.

languageCode
languageCode: "en-us";

The language code of the captions (e.g., "en-us" for English, US).

provider
provider: "aws-transcribe";

The caption provider (e.g., "aws-transcribe").

reason?
optional reason: string;

An optional reason for the caption status.

sessionId
sessionId: string;

The Vonage Video session ID associated with the broadcast.

status
status: CaptionStatus;

The status of the captions.

updatedAt
updatedAt: number;

The timestamp when the caption was last updated, expressed in milliseconds since the Unix epoch.

Defined in

video/lib/types/Response/CaptionStatusResponse.ts:6


ClientTokenClaims

type ClientTokenClaims: object;

Interface representing claims for a client token.

Type declaration

acl
acl: object;

Access control list (ACL) for paths.

acl.paths
acl.paths: object;

Paths and associated objects in the ACL.

Index Signature

[key: string]: object

connection_data?
optional connection_data: string;

Connection data associated with the token (optional).

data?
optional data: string;

Additional data for the token (optional).

exp?
optional exp: number;

The expiration time of the token (optional).

initial_layout_class_list
initial_layout_class_list: string;

The initial layout class list.

role
role: string;

The role of the token.

scope
scope: string;

The scope of the token.

session_id
session_id: string;

The session ID associated with the token.

sub
sub: string;

The subject of the token.

Defined in

video/lib/types/ClientTokenClaims.ts:4


ClientTokenOptions

type ClientTokenOptions: object;

Interface representing options for generating a client token.

Type declaration

data?
optional data: string;

Additional data for the client token (optional).

expireTime?
optional expireTime: number;

The expiration time of the client token in seconds (optional).

initialLayoutClassList?
optional initialLayoutClassList: string[];

An array of initial layout class list for the client token (optional).

role?
optional role: string;

The role associated with the client token (optional).

Defined in

video/lib/types/ClientTokenOptions.ts:4


CreateSessionResponse

type CreateSessionResponse: object;

Represents a response containing the details of a created session.

Type declaration

create_dt
create_dt: string;

The creation date and time of the session in string format.

media_server_url
media_server_url: string;

The URL of the media server associated with the session.

project_id
project_id: string;

The project ID associated with the session.

session_id
session_id: string;

The unique session ID.

Defined in

video/lib/types/Response/CreateSessionResponse.ts:4


EnableCaptionResponse

type EnableCaptionResponse: object;

Represents a response indicating the ID of the enabled caption.

Type declaration

captionsId
captionsId: string;

The unique ID of the enabled caption.

Defined in

video/lib/types/Response/EnableCaptionResponse.ts:4


ExperienceComposerListFilter

type ExperienceComposerListFilter: object;

Interface representing filters for listing Experience Composer items.

Type declaration

count?
optional count: number;

The maximum number of items to retrieve (optional).

offset?
optional offset: number;

The offset for paginating through the list (optional).

Defined in

video/lib/types/ExperienceComposerListFilter.ts:4


ExperienceComposerOptions

type ExperienceComposerOptions: object;

Interface representing options for creating an Experience Composer.

Type declaration

maxDuration?
optional maxDuration: number;

The maximum duration for the Experience Composer (optional).

properties?
optional properties: object;

Optional properties for the Experience Composer.

properties.name?
optional properties.name: string;

The name of the Experience Composer.

resolution?
optional resolution: ExperienceComposerResolution;

The resolution of the Experience Composer (optional).

statusCallbackUrl?
optional statusCallbackUrl: string;

The callback URL for status updates (optional).

url
url: string;

The URL of the Experience Composer.

Defined in

video/lib/types/ExperienceComposerOptions.ts:6


ExperienceComposerResponse

type ExperienceComposerResponse: object;

Represents a response from the Experience Composer.

Type declaration

applicationId
applicationId: string;

The application ID associated with the response.

createdAt
createdAt: number;

The timestamp when the response was created (milliseconds since the Unix epoch).

id
id: string;

The unique ID of the response.

reason?
optional reason: string;

An optional reason for the status, if available.

resolution
resolution: ExperienceComposerResolution;

The resolution used by the Experience Composer.

sessionId
sessionId: string;

The session ID associated with the response.

status
status: "starting" | "started" | "stopped" | "failed";

The status of the response, which can be one of: "starting", "started", "stopped", "failed".

streamId
streamId: string;

The stream ID associated with the response.

updatedAt
updatedAt: number;

The timestamp when the response was last updated (milliseconds since the Unix epoch).

url
url: string;

The URL associated with the response.

Defined in

video/lib/types/Response/ExperienceComposerResponse.ts:6


HLSConfig

type HLSConfig: object;

Interface representing configuration options for HLS streaming.

Type declaration

dvr?
optional dvr: boolean;

Whether to enable DVR functionality (rewinding, pausing, and resuming) in players that support it.

lowLatency?
optional lowLatency: boolean;

Whether to enable low-latency mode for the HLS stream.

Defined in

video/lib/types/BroadcastConfig.ts:7


HlsSettings

type HlsSettings: object;

Represents HLS settings for a live streaming broadcast.

Type declaration

lowLatency?
optional lowLatency: boolean;

Whether to enable low-latency mode for the HLS stream.

Defined in

video/lib/types/Response/BroadcastDetailsResponse.ts:7


InitiateSIPCallRequest

type InitiateSIPCallRequest: SIPCallOptions & object;

Represents the request to initiate a SIP call with additional session information.

Type declaration

sessionId
sessionId: string;

The session ID of the Vonage Video session to associate with the SIP call.

Defined in

video/lib/types/Request/InitiateSIPCallRequest.ts:6


MultiArchiveResponse

type MultiArchiveResponse: object;

Represents a response containing multiple archive items.

Type declaration

count
count: number;

The count of archive items in the response.

items
items: SingleArchiveResponse[];

An array of SingleArchiveResponse objects representing individual archive items.

Defined in

video/lib/types/Response/MultiArchiveResponse.ts:6


MultiBroadcastResponse

type MultiBroadcastResponse: object;

Represents a response containing multiple broadcast details items.

Type declaration

count
count: number;

The count of broadcast details items in the response.

items
items: BroadcastDetailsResponse[];

An array of BroadcastDetailsResponse objects representing individual broadcast details items.

Defined in

video/lib/types/Response/MultiBroadcastResponse.ts:6


MultiExperienceComposerResponse

type MultiExperienceComposerResponse: object;

Represents a response containing multiple ExperienceComposerResponse items.

Type declaration

count
count: number;

The count of ExperienceComposerResponse items in the response.

items
items: ExperienceComposerResponse[];

An array of ExperienceComposerResponse objects representing individual items.

Defined in

video/lib/types/Response/MultiExperienceComposerResponse.ts:6


MultiStreamLayoutResponse

type MultiStreamLayoutResponse: object;

Represents a response containing multiple SingleStreamLayoutResponse items.

Type declaration

count
count: number;

The count of SingleStreamLayoutResponse items in the response.

items
items: SingleStreamLayoutResponse[];

An array of SingleStreamLayoutResponse objects representing individual items.

Defined in

video/lib/types/Response/MultiStreamLayoutResponse.ts:6


ProjectDetailsResponse

type ProjectDetailsResponse: object;

Represents the details of a project.

Type declaration

createdAt
createdAt: number;

The timestamp when the project was created, expressed in milliseconds since the Unix epoch.

environment
environment: string;

The environment of the project.

id
id: string;

The unique identifier of the project.

name
name: string;

The name of the project.

secret
secret: string;

The secret associated with the project.

status
status: string;

The status of the project.

Defined in

video/lib/types/Response/ProjectDetailsResponse.ts:4


RTMPStream

type RTMPStream: object;

Interface representing an RTMP stream configuration.

Type declaration

id?
optional id: string;

Optional unique identifier for the RTMP stream.

serverUrl
serverUrl: string;

The RTMP server URL to which the stream will be sent.

streamName
streamName: string;

The name of the stream on the RTMP server.

Defined in

video/lib/types/RTMPStream.ts:4


Session

type Session: object;

Interface representing a session configuration.

Type declaration

archiveMode
archiveMode: string;

The archive mode for the session (e.g., "MANUAL" or "ALWAYS").

location
location: string;

The location of the session.

mediaMode
mediaMode: string;

The media mode for the session (e.g., "ROUTED" or "RELAYED").

sessionId
sessionId: string;

The unique identifier for the session.

Defined in

video/lib/types/Session.ts:4


Signal

type Signal: object;

Represents a signal containing type and data properties.

Type declaration

data
data: string;

The data associated with the signal, which can be any string data related to the signal.

type
type: string;

The type of the signal, which can be a custom string identifying the signal type.

Defined in

video/lib/types/Singal.ts:4


SingleArchiveResponse

type SingleArchiveResponse: object;

Represents the details of a single archive.

Type declaration

createdAt
createdAt: number;

The timestamp when the archive was created, expressed in milliseconds since the Unix epoch.

duration
duration: number;

The duration of the archive in seconds.

hasAudio
hasAudio: boolean;

Indicates whether the archive has audio.

hasVideo
hasVideo: boolean;

Indicates whether the archive has video.

id
id: string;

The unique identifier of the archive.

name
name: string;

The name of the archive.

outputMode
outputMode: string;

The output mode of the archive.

projectId
projectId: string;

The unique identifier of the project to which the archive belongs.

reason
reason: string;

The reason for the archive status.

resolution
resolution: string;

The resolution of the archive.

sessionId
sessionId: string;

The unique identifier of the session associated with the archive.

size
size: number;

The size of the archive in bytes.

status
status: string;

The status of the archive.

streamMode
streamMode: string;

The stream mode of the archive.

streams?
optional streams: string[];

An array of stream identifiers associated with the archive.

url?
optional url: string;

The URL of the archive.

Defined in

video/lib/types/Response/SingleArchiveResponse.ts:4


SingleStreamLayoutResponse

type SingleStreamLayoutResponse: object;

Represents the details of a single stream layout.

Type declaration

id
id: string;

The unique identifier of the stream layout.

layoutClassList
layoutClassList: string[];

An array of CSS class names associated with the layout.

name
name: string;

The name of the stream layout.

videoType
videoType: string;

The type of video associated with the stream layout.

Defined in

video/lib/types/Response/SingleStreamLayoutResponse.ts:4


SIPCallOptions

type SIPCallOptions: object;

Interface representing options for initiating a SIP call.

Type declaration

sip
sip: SIPCallSIPConfig;

Configuration options for the SIP call.

token
token: string;

The authentication token for the SIP call.

Defined in

video/lib/types/SIPCallOptions.ts:56


SIPCallResponse

type SIPCallResponse: object;

Represents the response for a SIP call initiation.

Type declaration

connectionId
connectionId: string;

The connection identifier associated with the SIP call.

id
id: string;

The unique identifier of the SIP call.

streamId
streamId: string;

The stream identifier associated with the SIP call.

Defined in

video/lib/types/Response/SIPCallResponse.ts:4


SIPCallSIPConfig

type SIPCallSIPConfig: object;

Configuration options for a SIP call.

Type declaration

auth?
optional auth: object;

Authentication credentials for the SIP call.

auth.password
auth.password: string;

The password for SIP authentication.

auth.username
auth.username: string;

The username for SIP authentication.

from?
optional from: string;

The optional "from" field for the SIP call.

headers?
optional headers: object;

Custom headers to be included in the SIP call.

Index Signature

[key: string]: string

observeForceMute?
optional observeForceMute: boolean;

Indicates whether to observe and force mute for the SIP call.

secure?
optional secure: boolean;

Indicates whether the SIP call should be secure.

uri
uri: string;

The SIP URI to initiate the call.

video?
optional video: boolean;

Indicates whether video is enabled for the SIP call.

Defined in

video/lib/types/SIPCallOptions.ts:4


StreamClassList

type StreamClassList: object;

Represents a stream with associated layout class list.

Type declaration

id
id: string;

The ID of the stream.

layoutClassList
layoutClassList: string[];

An array of layout class names associated with the stream.

Defined in

video/lib/types/StreamClassList.ts:4


VideoClassParameters

type VideoClassParameters: AuthParams & VetchOptions & object;

Parameters required to initialize the Video class.

Type declaration

applicationId
applicationId: string;

The unique identifier for the application.

auth?
optional auth: AuthInterface;

Optional authentication interface to use for custom authentication.

privateKey
privateKey: string;

The private key used for authentication.

Defined in

video/lib/parameters/VideoClassParameters.ts:8


VideoResponse<T>

type VideoResponse<T>: VetchResponse<T>;

Represents a video response that wraps a Vetch response.

Type Parameters

T

Defined in

video/lib/types/VideoResponse.ts:6


WebSocketConfig

type WebSocketConfig: object;

Configuration options for establishing a WebSocket connection.

Type declaration

audioRate?
optional audioRate: AudioRate;

The audio rate to be used for the WebSocket connection.

headers?
optional headers: object;

Optional headers to include in the WebSocket request.

Index Signature

[key: string]: string

streams?
optional streams: string[];

An array of stream IDs to associate with the WebSocket connection.

uri
uri: string;

The URI to connect to the WebSocket server.

Defined in

video/lib/types/WebSocketConfig.ts:6


WebSocketConnectResponse

type WebSocketConnectResponse: object;

Represents the response for a WebSocket connection.

Type declaration

connectionId
connectionId: string;

The connection identifier associated with the WebSocket connection.

id
id: string;

The unique identifier of the WebSocket connection.

Defined in

video/lib/types/Response/WebSocketConnectResponse.ts:4

Clone this wiki locally