Suggestions

close search

Add Messaging, Voice, and Authentication to your apps with Vonage Communications APIs

Visit the Vonage API Developer Portal

OpenTokSDK.OpenTok

Contains methods for creating Vonage Video API sessions, generating tokens, and working with archives. More...

Public Member Functions

async Task< AudioConnectorStartAudioConnectorAsync (AudioConnectorStartRequest request)
 Sends audio from a Vonage Video API session to a WebSocket. For more information, see the Audio Connector developer guide. More...
async Task StopAudioConnectorAsync (string connectionId)
 Stops sending audio for a Vonage Video API session. More...
void SetCustomUserAgent (string value)
 Sets a custom user-agent value. The HttpClient will append this value, if it exists, to the initial user-agent value. More...
 OpenTok (int apiKey, string apiSecret)
 Creates an OpenTok object. More...
 OpenTok (int apiKey, string apiSecret, string apiUrl)
 For TokBox internal use. More...
Session CreateSession (string location="", MediaMode mediaMode=MediaMode.RELAYED, ArchiveMode archiveMode=ArchiveMode.MANUAL, bool encryption=false, string archiveName="", RenderResolution archiveResolution=RenderResolution.StandardDefinitionLandscape)
 Creates a new Vonage Video API session. More...
async Task< SessionCreateSessionAsync (string location="", MediaMode mediaMode=MediaMode.RELAYED, ArchiveMode archiveMode=ArchiveMode.MANUAL, bool encryption=false, string archiveName="", RenderResolution archiveResolution=RenderResolution.StandardDefinitionLandscape)
 Creates a new Vonage Video API session. More...
string GenerateToken (string sessionId, Role role=Role.PUBLISHER, double expireTime=0, string data=null, List< string > initialLayoutClassList=null)
 Creates a token for connecting to an Vonage Video API session. In order to authenticate a user connecting to an Vonage Video API session, the client passes a token when connecting to the session. More...
Archive StartArchive (string sessionId, string name="", bool hasVideo=true, bool hasAudio=true, OutputMode outputMode=OutputMode.COMPOSED, string resolution=null, ArchiveLayout layout=null, StreamMode? streamMode=null, string multiArchiveTag=null)
 Starts archiving an Vonage Video API session. More...
async Task< ArchiveStartArchiveAsync (string sessionId, string name="", bool hasVideo=true, bool hasAudio=true, OutputMode outputMode=OutputMode.COMPOSED, string resolution=null, ArchiveLayout layout=null, StreamMode? streamMode=null, string multiArchiveTag=null)
 Starts archiving an Vonage Video API session. More...
Archive StopArchive (string archiveId)
 Stops an OpenTok archive that is being recorded. More...
async Task< ArchiveStopArchiveAsync (string archiveId)
 Stops an OpenTok archive that is being recorded. More...
ArchiveList ListArchives (int offset=0, int count=0, string sessionId="")
 Returns a List of Archive objects, representing archives that are both both completed and in-progress, for your API key. More...
async Task< ArchiveListListArchivesAsync (int offset=0, int count=0, string sessionId="")
 Returns a List of Archive objects, representing archives that are both both completed and in-progress, for your API key. More...
Archive GetArchive (string archiveId)
 Gets an Archive object for the given archive ID. More...
async Task< ArchiveGetArchiveAsync (string archiveId)
 Gets an Archive object for the given archive ID. More...
void DeleteArchive (string archiveId)
 Deletes an OpenTok archive. More...
Task DeleteArchiveAsync (string archiveId)
 Deletes an OpenTok archive. More...
void AddStreamToArchive (string archiveId, string streamId, bool hasAudio=true, bool hasVideo=true)
 Adds a stream to a currently running composed archive that was started with the streamMode set to StreamMode.Manual. You can call the method repeatedly with the same stream ID, to toggle the stream's audio or video in the archive. More...
Task AddStreamToArchiveAsync (string archiveId, string streamId, bool hasAudio=true, bool hasVideo=true)
 Adds a stream to a currently running composed archive that was started with the streamMode set to StreamMode.Manual. You can call the method repeatedly with the same stream ID, to toggle the stream's audio or video in the archive. More...
void RemoveStreamFromArchive (string archiveId, string streamId)
 Removes a stream from a composed archive that was started with the streamMode set to StreamMode.Manual. More...
Task RemoveStreamFromArchiveAsync (string archiveId, string streamId)
 Removes a stream from a composed archive that was started with the streamMode set to StreamMode.Manual. More...
Stream GetStream (string sessionId, string streamId)
 Gets a Stream object for the given stream ID. More...
async Task< StreamGetStreamAsync (string sessionId, string streamId)
 Gets a Stream object for the given stream ID. More...
StreamList ListStreams (string sessionId)
 Returns a List of Stream objects, representing streams that are in-progress, for the session ID. More...
async Task< StreamListListStreamsAsync (string sessionId)
 Returns a List of Stream objects, representing streams that are in-progress, for the session ID. More...
void ForceDisconnect (string sessionId, string connectionId)
 Force a specific client to disconnect from an Vonage Video API session. More...
async Task ForceDisconnectAsync (string sessionId, string connectionId)
 Force a specific client to disconnect from an Vonage Video API session. More...
Broadcast StartBroadcast (string sessionId, bool hls=true, List< Rtmp > rtmpList=null, string resolution=null, int maxDuration=7200, BroadcastLayout layout=null, StreamMode? streamMode=null, bool dvr=false, bool? lowLatency=null, string multiBroadcastTag=null, bool hasAudio=true, bool hasVideo=true)
 Use this method to start a live streaming for an Vonage Video API session. This broadcasts the session to an HLS (HTTP live streaming) or to RTMP streams. More...
async Task< BroadcastStartBroadcastAsync (string sessionId, bool hls=true, List< Rtmp > rtmpList=null, string resolution=null, int maxDuration=7200, BroadcastLayout layout=null, StreamMode? streamMode=null, bool dvr=false, bool? lowLatency=null, string multiBroadcastTag=null, bool hasAudio=true, bool hasVideo=true)
 Use this method to start a live streaming for an Vonage Video API session. This broadcasts the session to an HLS (HTTP live streaming) or to RTMP streams. More...
Broadcast StopBroadcast (string broadcastId)
 Use this method to stop a live broadcast of an Vonage Video API session. Note that broadcasts automatically stop 120 minutes after they are started. More...
async Task< BroadcastStopBroadcastAsync (string broadcastId)
 Use this method to stop a live broadcast of an Vonage Video API session. Note that broadcasts automatically stop 120 minutes after they are started. More...
Broadcast GetBroadcast (string broadcastId)
 Use this method to get a live streaming broadcast object of an Vonage Video API session. More...
async Task< BroadcastGetBroadcastAsync (string broadcastId)
 Use this method to get a live streaming broadcast object of an Vonage Video API session. More...
void SetBroadcastLayout (string broadcastId, BroadcastLayout layout)
 Sets the layout type for the broadcast. For a description of layout types, see Configuring the video layout for OpenTok live streaming broadcasts. More...
async Task SetBroadcastLayoutAsync (string broadcastId, BroadcastLayout layout)
 Sets the layout type for the broadcast. For a description of layout types, see Configuring the video layout for OpenTok live streaming broadcasts. More...
bool SetArchiveLayout (string archiveId, ArchiveLayout layout)
 Allows you to dynamically change the layout of a composed archive while it's being recorded see Customizing the video layout for composed archives for details regarding customizing a layout. More...
void AddStreamToBroadcast (string broadcastId, string streamId, bool hasAudio=true, bool hasVideo=true)
 Adds a stream to a currently running broadcast that was started with the the streamMode set to StreamMode.Manual. You can call the method repeatedly with the same stream ID, to toggle the stream's audio or video in the broadcast. More...
Task AddStreamToBroadcastAsync (string broadcastId, string streamId, bool hasAudio=true, bool hasVideo=true)
 Adds a stream to a currently running broadcast that was started with the the streamMode set to StreamMode.Manual. You can call the method repeatedly with the same stream ID, to toggle the stream's audio or video in the broadcast. More...
void RemoveStreamFromBroadcast (string broadcastId, string streamId)
 Removes a stream from a broadcast that was started with the the streamMode set to StreamMode.Manual. More...
Task RemoveStreamFromBroadcastAsync (string broadcastId, string streamId)
 Removes a stream from a broadcast that was started with the the streamMode set to StreamMode.Manual. More...
async Task< bool > SetArchiveLayoutAsync (string archiveId, ArchiveLayout layout)
 Allows you to dynamically change the layout of a composed archive while it's being recorded see Customizing the video layout for composed archives for details regarding customizing a layout. More...
void SetStreamClassLists (string sessionId, List< StreamProperties > streams)
 Sets the layout class list for streams in a session. Layout classes are used in the layout for composed archives and live streaming broadcasts. For more information, see Customizing the video layout for composed archives and Configuring video layout for OpenTok live streaming broadcasts. More...
async Task SetStreamClassListsAsync (string sessionId, List< StreamProperties > streams)
 Sets the layout class list for streams in a session. Layout classes are used in the layout for composed archives and live streaming broadcasts. For more information, see Customizing the video layout for composed archives and Configuring video layout for OpenTok live streaming broadcasts. More...
void Signal (string sessionId, SignalProperties signalProperties, string connectionId=null)
 Sends a signal to clients (or a specific client) connected to an Vonage Video API session. More...
async Task SignalAsync (string sessionId, SignalProperties signalProperties, string connectionId=null)
 Sends a signal to clients (or a specific client) connected to an Vonage Video API session. More...
void SetDefaultRequestTimeout (int timeout)
 Set's the default request timeout (in milliseconds) for all WebRequest's sent by the SDK More...
void PlayDTMF (string sessionId, string digits, string connectionId=null)
 Send DTMF digits to all participants in an active Vonage Video API session or to a specific client connected to that session. More...
Task PlayDTMFAsync (string sessionId, string digits, string connectionId=null)
 Send DTMF digits to all participants in an active Vonage Video API session or to a specific client connected to that session. More...
Sip Dial (string sessionId, string token, string sipUri, DialOptions options=null)
 Connects a SIP platform to an Vonage Video API session. More...
async Task< SipDialAsync (string sessionId, string token, string sipUri, DialOptions options=null)
 Connects a SIP platform to an Vonage Video API session. More...
void ForceMuteStream (string sessionId, string streamId)
 Force the publisher of a specific stream to mute its published audio. More...
async Task ForceMuteStreamAsync (string sessionId, string streamId)
 Force the publisher of a specific stream to mute its published audio. More...
void ForceMuteAll (string sessionId, string[] excludedStreamIds)
 Forces all streams (except for an optional list of streams) in a session to mute published audio. More...
async Task ForceMuteAllAsync (string sessionId, string[] excludedStreamIds)
 Forces all streams (except for an optional list of streams) in a session to mute published audio. More...
void DisableForceMute (string sessionId)
 Disables the active mute state of the session. After you call this method, new streams published to the session will no longer have audio muted. More...
async Task DisableForceMuteAsync (string sessionId)
 Disables the active mute state of the session. After you call this method, new streams published to the session will no longer have audio muted. More...
async Task< RenderItemStartRenderAsync (StartRenderRequest request)
 Starts a new Experience Composer renderer for an Vonage Video API session. More...
async Task StopRenderAsync (string renderId)
 Stops an Experience Composer renderer. More...
async Task< ListRendersResponseListRendersAsync (ListRendersRequest request)
 Retrieves all Experience Composer renderers matching the provided request. More...
async Task< RenderItemGetRenderAsync (string renderId)
 Retrieves an Experience Composer renderer. More...

Properties

int ApiKey [get]
 The Vonage Video API key passed into the OpenTok() constructor. More...
string ApiSecret [get]
 The Vonage Video API secret passed into the OpenTok() constructor. More...
HttpClient Client [get, set]
 For internal use More...
bool Debug [get, set]
 Enables writing request/response details to console. Don't use in a production environment. More...

Detailed Description

Contains methods for creating Vonage Video API sessions, generating tokens, and working with archives.

To create a new OpenTok object, call the OpenTok() constructor with your Vonage Video API key and the API secret for your OpenTok project. Do not publicly share your API secret. You will use it with the OpenTok constructor (only on your web server) to create Vonage Video API sessions.

Constructor & Destructor Documentation

◆ OpenTok() [1/2]

OpenTokSDK.OpenTok.OpenTok ( int  apiKey,
string  apiSecret 
)

Creates an OpenTok object.

Parameters
apiKeyYour Vonage Video API key. (See the TokBox account page
apiSecretYour Vonage Video API secret. (See the TokBox account page

◆ OpenTok() [2/2]

OpenTokSDK.OpenTok.OpenTok ( int  apiKey,
string  apiSecret,
string  apiUrl 
)

For TokBox internal use.

Parameters
apiKey
apiSecret
apiUrl

Member Function Documentation

◆ AddStreamToArchive()

void OpenTokSDK.OpenTok.AddStreamToArchive ( string  archiveId,
string  streamId,
bool  hasAudio = true,
bool  hasVideo = true 
)

Adds a stream to a currently running composed archive that was started with the streamMode set to StreamMode.Manual. You can call the method repeatedly with the same stream ID, to toggle the stream's audio or video in the archive.

Parameters
archiveIdThe archive ID.
streamIdThe stream ID.
hasAudioWhether the composed archive should include the stream's audio (true, the default) or not (false).
hasVideoWhether the composed archive should include the stream's video (true, the default) or not (false).

◆ AddStreamToArchiveAsync()

Task OpenTokSDK.OpenTok.AddStreamToArchiveAsync ( string  archiveId,
string  streamId,
bool  hasAudio = true,
bool  hasVideo = true 
)

Adds a stream to a currently running composed archive that was started with the streamMode set to StreamMode.Manual. You can call the method repeatedly with the same stream ID, to toggle the stream's audio or video in the archive.

Parameters
archiveIdThe archive ID.
streamIdThe stream ID.
hasAudioWhether the composed archive should include the stream's audio (true, the default) or not (false).
hasVideoWhether the composed archive should include the stream's video (true, the default) or not (false).

◆ AddStreamToBroadcast()

void OpenTokSDK.OpenTok.AddStreamToBroadcast ( string  broadcastId,
string  streamId,
bool  hasAudio = true,
bool  hasVideo = true 
)

Adds a stream to a currently running broadcast that was started with the the streamMode set to StreamMode.Manual. You can call the method repeatedly with the same stream ID, to toggle the stream's audio or video in the broadcast.

Parameters
broadcastIdThe broadcast ID.
streamIdThe stream ID.
hasAudioWhether the broadcast should include the stream's audio (true, the default) or not (false).
hasVideoWhether the broadcast should include the stream's video (true, the default) or not (false).
Exceptions
OpenTokArgumentException

◆ AddStreamToBroadcastAsync()

Task OpenTokSDK.OpenTok.AddStreamToBroadcastAsync ( string  broadcastId,
string  streamId,
bool  hasAudio = true,
bool  hasVideo = true 
)

Adds a stream to a currently running broadcast that was started with the the streamMode set to StreamMode.Manual. You can call the method repeatedly with the same stream ID, to toggle the stream's audio or video in the broadcast.

Parameters
broadcastIdThe broadcast ID.
streamIdThe stream ID.
hasAudioWhether the broadcast should include the stream's audio (true, the default) or not (false).
hasVideoWhether the broadcast should include the stream's video (true, the default) or not (false).
Exceptions
OpenTokArgumentException

◆ CreateSession()

Session OpenTokSDK.OpenTok.CreateSession ( string  location = "",
MediaMode  mediaMode = MediaMode.RELAYED,
ArchiveMode  archiveMode = ArchiveMode.MANUAL,
bool  encryption = false,
string  archiveName = "",
RenderResolution  archiveResolution = RenderResolution.StandardDefinitionLandscape 
)

Creates a new Vonage Video API session.

Vonage Video API sessions do not expire. However, authentication tokens do expire (see the generateToken() method). Also note that sessions cannot explicitly be destroyed.

A session ID string can be up to 255 characters long.

Calling this method results in an OpenTokException in the event of an error. Check the error message for details.

You can also create a session using the OpenTok REST API or by logging in to your TokBox account.

Parameters
locationAn IP address that the Vonage Video API servers will use to situate the session in its global network. If you do not set a location hint, the Vonage Video API servers will be based on the first client connecting to the session.
mediaModeWhether the session will transmit streams using the Vonage Video API Media Router (MediaMode.ROUTED) or not (MediaMode.RELAYED). By default, the setting is MediaMode.RELAYED. With the parameter set to MediaMode.RELAYED, the session will attempt to transmit streams directly between clients. If clients cannot connect due to firewall restrictions, the session uses the OpenTok TURN server to relay streams. The OpenTok Media Router provides the following benefits:
  • The Vonage Video API Media Router can decrease bandwidth usage in multiparty sessions. (When the mediaMode parameter is set to MediaMode.ROUTED, each client must send a separate audio-video stream to each client subscribing to it.)
  • The Vonage Video API Media Router can improve the quality of the user experience through audio fallback and video recovery With these features, if a client's connectivity degrades to a degree that it does not support video for a stream it's subscribing to, the video is dropped on that client (without affecting other clients), and the client receives audio only. If the client's connectivity improves, the video returns.
  • The Vonage Video API Media Router supports the archiving feature, which lets you record, save, and retrieve Vonage Video API sessions.
archiveModeWhether the session is automatically archived (ArchiveMode.ALWAYS) or not (ArchiveMode.MANUAL). By default, the setting is ArchiveMode.MANUAL and you must call the StartArchive method of the OpenTok object to start archiving. To archive the session (either automatically or not), you must set the mediaMode parameter to MediaMode.ROUTED
encryptionEnables end-to-end media encryption in routed sessions.
archiveNameName of the archives in auto archived sessions. A session that begins with archive mode 'always' will be using this archive name for all archives of that session. Passing 'archiveName' with archive mode 'manual' will cause an error response.
archiveResolutionResolution of the archives in auto archived sessions. A session that begins with archive mode 'always' will be using this resolution for all archives of that session. Passing 'archiveResolution' with archive mode 'manual' will cause an error response.
Returns
A Session object representing the new session. The Session.Id property of the Session is the session ID, which uniquely identifies the session. You will use this session ID in the client SDKs to identify the session. For example, when using the OpenTok.js library, use the session ID when calling the OT.initSession() method (to initialize an Vonage Video API session).

◆ CreateSessionAsync()

async Task<Session> OpenTokSDK.OpenTok.CreateSessionAsync ( string  location = "",
MediaMode  mediaMode = MediaMode.RELAYED,
ArchiveMode  archiveMode = ArchiveMode.MANUAL,
bool  encryption = false,
string  archiveName = "",
RenderResolution  archiveResolution = RenderResolution.StandardDefinitionLandscape 
)

Creates a new Vonage Video API session.

Vonage Video API sessions do not expire. However, authentication tokens do expire (see the generateToken() method). Also note that sessions cannot explicitly be destroyed.

A session ID string can be up to 255 characters long.

Calling this method results in an OpenTokException in the event of an error. Check the error message for details.

You can also create a session using the OpenTok REST API or by logging in to your TokBox account.

Parameters
locationAn IP address that the Vonage Video API servers will use to situate the session in its global network. If you do not set a location hint, the Vonage Video API servers will be based on the first client connecting to the session.
mediaModeWhether the session will transmit streams using the Vonage Video API Media Router (MediaMode.ROUTED) or not (MediaMode.RELAYED). By default, the setting is MediaMode.RELAYED. With the parameter set to MediaMode.RELAYED, the session will attempt to transmit streams directly between clients. If clients cannot connect due to firewall restrictions, the session uses the OpenTok TURN server to relay streams. The OpenTok Media Router provides the following benefits:
  • The Vonage Video API Media Router can decrease bandwidth usage in multiparty sessions. (When the mediaMode parameter is set to MediaMode.ROUTED, each client must send a separate audio-video stream to each client subscribing to it.)
  • The Vonage Video API Media Router can improve the quality of the user experience through audio fallback and video recovery With these features, if a client's connectivity degrades to a degree that it does not support video for a stream it's subscribing to, the video is dropped on that client (without affecting other clients), and the client receives audio only. If the client's connectivity improves, the video returns.
  • The Vonage Video API Media Router supports the archiving feature, which lets you record, save, and retrieve Vonage Video API sessions.
archiveModeWhether the session is automatically archived (ArchiveMode.ALWAYS) or not (ArchiveMode.MANUAL). By default, the setting is ArchiveMode.MANUAL and you must call the StartArchive method of the OpenTok object to start archiving. To archive the session (either automatically or not), you must set the mediaMode parameter to MediaMode.ROUTED
encryptionEnables end-to-end media encryption in routed sessions.
archiveNameName of the archives in auto archived sessions. A session that begins with archive mode 'always' will be using this archive name for all archives of that session. Passing 'archiveName' with archive mode 'manual' will cause an error response.
archiveResolutionResolution of the archives in auto archived sessions. A session that begins with archive mode 'always' will be using this resolution for all archives of that session. Passing 'archiveResolution' with archive mode 'manual' will cause an error response.
Returns
A Session object representing the new session. The Session.Id property of the Session is the session ID, which uniquely identifies the session. You will use this session ID in the client SDKs to identify the session. For example, when using the OpenTok.js library, use the session ID when calling the OT.initSession() method (to initialize an Vonage Video API session).

◆ DeleteArchive()

void OpenTokSDK.OpenTok.DeleteArchive ( string  archiveId)

Deletes an OpenTok archive.

You can only delete an archive which has a status of "available" or "uploaded". Deleting an archive removes its record from the list of archives. For an "available" archive, it also removes the archive file, making it unavailable for download.

Parameters
archiveIdThe archive ID of the archive you want to delete.

◆ DeleteArchiveAsync()

Task OpenTokSDK.OpenTok.DeleteArchiveAsync ( string  archiveId)

Deletes an OpenTok archive.

You can only delete an archive which has a status of "available" or "uploaded". Deleting an archive removes its record from the list of archives. For an "available" archive, it also removes the archive file, making it unavailable for download.

Parameters
archiveIdThe archive ID of the archive you want to delete.

◆ Dial()

Sip OpenTokSDK.OpenTok.Dial ( string  sessionId,
string  token,
string  sipUri,
DialOptions  options = null 
)

Connects a SIP platform to an Vonage Video API session.

For more information, including technical details and security considerations, see the the OpenTok SIP interconnect developer guide.

Parameters
sessionIdThe session ID corresponding to the session to which the user will connect.
tokenThe token for the session ID with which the SIP user will use to connect.
sipUriThe SIP URI to be used as destination of the SIP call initiated from OpenTok to your SIP platform. If the SIP URI contains a ​transport=tls​ header, the negotiation between OpenTok and the SIP endpoint will be done securely. Note that this will only apply to the negotiation itself, and not to the transmission of audio. If you also audio transmission to be encrypted, set the Secure property of the of the DialOptions object passed into the options parameter to ​true​. This is an example of setting sipUri for a secure call negotiation: "sip:user@sip.partner.com;transport=tls". This is an example of insecure call negotiation: "sip:user@sip.partner.com".
optionsOptional parameters for SIP dialing.

◆ DialAsync()

async Task<Sip> OpenTokSDK.OpenTok.DialAsync ( string  sessionId,
string  token,
string  sipUri,
DialOptions  options = null 
)

Connects a SIP platform to an Vonage Video API session.

For more information, including technical details and security considerations, see the the OpenTok SIP interconnect developer guide.

Also see OpenTok.Dial.

Parameters
sessionIdThe session ID corresponding to the session to which the user will connect.
tokenThe token for the session ID with which the SIP user will use to connect.
sipUriThe SIP URI to be used as destination of the SIP call initiated from OpenTok to your SIP platform. If the SIP URI contains a ​transport=tls​ header, the negotiation between OpenTok and the SIP endpoint will be done securely. Note that this will only apply to the negotiation itself, and not to the transmission of audio. If you also audio transmission to be encrypted, set the Secure property of the of the DialOptions object passed into the options parameter to ​true​. This is an example of setting sipUri for a secure call negotiation: "sip:user@sip.partner.com;transport=tls". This is an example of insecure call negotiation: "sip:user@sip.partner.com".
optionsOptional parameters for SIP dialing.

◆ DisableForceMute()

void OpenTokSDK.OpenTok.DisableForceMute ( string  sessionId)

Disables the active mute state of the session. After you call this method, new streams published to the session will no longer have audio muted.

After you call the ForceMuteAll method, any streams published after the call are published with audio muted. Call the DisableForceMute() method to remove the mute state of a session, so that new published streams are not automatically muted.

Also see the DisableForceMuteAsync method.

Parameters
sessionIdThe session ID.
Exceptions
OpenTokArgumentExceptionThrown when the session ID is invalid.
OpenTokWebExceptionThrown when an HTTP error has occurred.

◆ DisableForceMuteAsync()

async Task OpenTokSDK.OpenTok.DisableForceMuteAsync ( string  sessionId)

Disables the active mute state of the session. After you call this method, new streams published to the session will no longer have audio muted.

After you call the ForceMuteAllAsync method, any streams published after the call are published with audio muted. Call the DisableForceMuteAsync() method to remove the mute state of a session, so that new published streams are not automatically muted.

Also see the DisableForceMute method.

Parameters
sessionIdThe session ID.
Exceptions
OpenTokArgumentExceptionThrown when the session ID is invalid.
OpenTokWebExceptionThrown when an HTTP error has occurred.

◆ ForceDisconnect()

void OpenTokSDK.OpenTok.ForceDisconnect ( string  sessionId,
string  connectionId 
)

Force a specific client to disconnect from an Vonage Video API session.

Parameters
sessionIdThe session ID corresponding to the session.
connectionIdThe connectionId of the connection in a session.

◆ ForceDisconnectAsync()

async Task OpenTokSDK.OpenTok.ForceDisconnectAsync ( string  sessionId,
string  connectionId 
)

Force a specific client to disconnect from an Vonage Video API session.

Parameters
sessionIdThe session ID corresponding to the session.
connectionIdThe connectionId of the connection in a session.

◆ ForceMuteAll()

void OpenTokSDK.OpenTok.ForceMuteAll ( string  sessionId,
string []  excludedStreamIds 
)

Forces all streams (except for an optional list of streams) in a session to mute published audio.

In addition to existing streams, any streams that are published after the call to this method are published with audio muted. You can remove the mute state of a session by calling the DisableForceMute method.

Also see the ForceMuteAllAsync and ForceMuteStream methods.

Parameters
sessionIdThe ID of session.
excludedStreamIdsThe stream IDs of streams that will not be muted.
Exceptions
OpenTokArgumentExceptionThrown when the session ID is invalid.
OpenTokWebExceptionThrown when an HTTP error has occurred.

◆ ForceMuteAllAsync()

async Task OpenTokSDK.OpenTok.ForceMuteAllAsync ( string  sessionId,
string []  excludedStreamIds 
)

Forces all streams (except for an optional list of streams) in a session to mute published audio.

In addition to existing streams, any streams that are published after the call to this method are published with audio muted. You can remove the mute state of a session by calling the DisableForceMuteAsync method.

Also see the ForceMuteAll and ForceMuteStreamAsync methods.

Parameters
sessionIdThe ID of session.
excludedStreamIdsThe stream IDs of streams that will not be muted.
Exceptions
OpenTokArgumentExceptionThrown when the session ID is invalid.
OpenTokWebExceptionThrown when an HTTP error has occurred.

◆ ForceMuteStream()

void OpenTokSDK.OpenTok.ForceMuteStream ( string  sessionId,
string  streamId 
)

Force the publisher of a specific stream to mute its published audio.

Also see the ForceMuteAll and ForceMuteStreamAsync methods.

Parameters
sessionIdThe session ID of the session that includes the stream.
streamIdThe stream ID.
Exceptions
OpenTokArgumentExceptionThrown when session or stream ID is invalid.
OpenTokWebExceptionThrown when an HTTP error has occurred.

◆ ForceMuteStreamAsync()

async Task OpenTokSDK.OpenTok.ForceMuteStreamAsync ( string  sessionId,
string  streamId 
)

Force the publisher of a specific stream to mute its published audio.

Also see the ForceMuteAll and ForceMuteStream methods.

Parameters
sessionIdThe session ID of the session that includes the stream.
streamIdThe stream ID.
Exceptions
OpenTokArgumentExceptionThrown when session or stream ID is invalid.
OpenTokWebExceptionThrown when an HTTP error has occurred.

◆ GenerateToken()

string OpenTokSDK.OpenTok.GenerateToken ( string  sessionId,
Role  role = Role.PUBLISHER,
double  expireTime = 0,
string  data = null,
List< string >  initialLayoutClassList = null 
)

Creates a token for connecting to an Vonage Video API session. In order to authenticate a user connecting to an Vonage Video API session, the client passes a token when connecting to the session.

For testing, you can also generate test tokens by logging in to your TokBox account.

Parameters
sessionIdThe session ID corresponding to the session to which the user will connect.
roleThe role for the token. Valid values are defined in the Role enum:
  • Role.SUBSCRIBER (A subscriber can only subscribe to streams)
  • Role.PUBLISHER (A publisher can publish streams, subscribe to streams, and signal. (This is the default value if you do not specify a role.))
  • Role.MODERATOR (In addition to the privileges granted to a publisher, a moderator can perform moderation functions, such as forcing clients to disconnect, to stop publishing streams, or to mute audio in published streams. See the Moderation developer guide.
expireTimeThe expiration time of the token, in seconds since the UNIX epoch. Pass in 0 to use the default expiration time of 24 hours after the token creation time. The maximum expiration time is 30 days after the creation time.
dataA string containing connection metadata describing the end-user. For example, you can pass the user ID, name, or other data describing the end-user. The length of the string is limited to 1000 characters. This data cannot be updated once it is set.
initialLayoutClassListA list of strings values containing the initial layout for the stream.
Returns

◆ GetArchive()

Archive OpenTokSDK.OpenTok.GetArchive ( string  archiveId)

Gets an Archive object for the given archive ID.

Parameters
archiveIdThe archive ID.
Returns
The Archive object.

◆ GetArchiveAsync()

async Task<Archive> OpenTokSDK.OpenTok.GetArchiveAsync ( string  archiveId)

Gets an Archive object for the given archive ID.

Parameters
archiveIdThe archive ID.
Returns
The Archive object.

◆ GetBroadcast()

Broadcast OpenTokSDK.OpenTok.GetBroadcast ( string  broadcastId)

Use this method to get a live streaming broadcast object of an Vonage Video API session.

For more information on broadcasting, see the Broadcast developer guide.

Parameters
broadcastIdThe broadcast ID of the broadcasting session
Returns
The Broadcast object. This object includes properties defining the broadcast, including the broadcast ID.

◆ GetBroadcastAsync()

async Task<Broadcast> OpenTokSDK.OpenTok.GetBroadcastAsync ( string  broadcastId)

Use this method to get a live streaming broadcast object of an Vonage Video API session.

For more information on broadcasting, see the Broadcast developer guide.

Parameters
broadcastIdThe broadcast ID of the broadcasting session
Returns
The Broadcast object. This object includes properties defining the broadcast, including the broadcast ID.

◆ GetRenderAsync()

async Task<RenderItem> OpenTokSDK.OpenTok.GetRenderAsync ( string  renderId)

Retrieves an Experience Composer renderer.

Parameters
renderIdThe Id of the rendering.

◆ GetStream()

Stream OpenTokSDK.OpenTok.GetStream ( string  sessionId,
string  streamId 
)

Gets a Stream object for the given stream ID.

Parameters
sessionIdThe session ID of the Vonage Video API session.
streamIdThe stream ID.
Returns
The Stream object.

◆ GetStreamAsync()

async Task<Stream> OpenTokSDK.OpenTok.GetStreamAsync ( string  sessionId,
string  streamId 
)

Gets a Stream object for the given stream ID.

Parameters
sessionIdThe session ID of the Vonage Video API session.
streamIdThe stream ID.
Returns
The Stream object.

◆ ListArchives()

ArchiveList OpenTokSDK.OpenTok.ListArchives ( int  offset = 0,
int  count = 0,
string  sessionId = "" 
)

Returns a List of Archive objects, representing archives that are both both completed and in-progress, for your API key.

Parameters
offsetThe index offset of the first archive. 0 is offset of the most recently started archive. 1 is the offset of the archive that started prior to the most recent archive.
countThe number of archives to be returned. The maximum number of archives returned is 1000.
sessionIdThe session ID.
Returns
A List of Archive objects.

◆ ListArchivesAsync()

async Task<ArchiveList> OpenTokSDK.OpenTok.ListArchivesAsync ( int  offset = 0,
int  count = 0,
string  sessionId = "" 
)

Returns a List of Archive objects, representing archives that are both both completed and in-progress, for your API key.

Parameters
offsetThe index offset of the first archive. 0 is offset of the most recently started archive. 1 is the offset of the archive that started prior to the most recent archive.
countThe number of archives to be returned. The maximum number of archives returned is 1000.
sessionIdThe session ID.
Returns
A List of Archive objects.

◆ ListRendersAsync()

async Task<ListRendersResponse> OpenTokSDK.OpenTok.ListRendersAsync ( ListRendersRequest  request)

Retrieves all Experience Composer renderers matching the provided request.

Parameters
requestThe request containing filtering options.
Returns
The list of rendering.

◆ ListStreams()

StreamList OpenTokSDK.OpenTok.ListStreams ( string  sessionId)

Returns a List of Stream objects, representing streams that are in-progress, for the session ID.

Parameters
sessionIdThe session ID corresponding to the session.
Returns
A List of Stream objects.
Exceptions
OpenTokArgumentException

◆ ListStreamsAsync()

async Task<StreamList> OpenTokSDK.OpenTok.ListStreamsAsync ( string  sessionId)

Returns a List of Stream objects, representing streams that are in-progress, for the session ID.

Parameters
sessionIdThe session ID corresponding to the session.
Returns
A List of Stream objects.
Exceptions
OpenTokArgumentException

◆ PlayDTMF()

void OpenTokSDK.OpenTok.PlayDTMF ( string  sessionId,
string  digits,
string  connectionId = null 
)

Send DTMF digits to all participants in an active Vonage Video API session or to a specific client connected to that session.

Parameters
sessionIdThe session ID corresponding to the session that will receive the DTMF string.
connectionIdThe connection connection ID of the client you are sending the DTMF signal to. Leave this empty to send a DTMF signal to all clients connected to the session.
digitsThis is the string of DTMF digits to send. This can include 0-9, '*', '#', and 'p'. A p indicates a pause of 500ms (if you need to add a delay in sending the digits).

◆ PlayDTMFAsync()

Task OpenTokSDK.OpenTok.PlayDTMFAsync ( string  sessionId,
string  digits,
string  connectionId = null 
)

Send DTMF digits to all participants in an active Vonage Video API session or to a specific client connected to that session.

Parameters
sessionIdThe session ID corresponding to the session that will receive the DTMF string.
connectionIdThe connection connection ID of the client you are sending the DTMF signal to. Leave this empty to send a DTMF signal to all clients connected to the session.
digitsThis is the string of DTMF digits to send. This can include 0-9, '*', '#', and 'p'. A p indicates a pause of 500ms (if you need to add a delay in sending the digits).

◆ RemoveStreamFromArchive()

void OpenTokSDK.OpenTok.RemoveStreamFromArchive ( string  archiveId,
string  streamId 
)

Removes a stream from a composed archive that was started with the streamMode set to StreamMode.Manual.

Parameters
archiveIdThe archive ID.
streamIdThe stream ID.

◆ RemoveStreamFromArchiveAsync()

Task OpenTokSDK.OpenTok.RemoveStreamFromArchiveAsync ( string  archiveId,
string  streamId 
)

Removes a stream from a composed archive that was started with the streamMode set to StreamMode.Manual.

Parameters
archiveIdThe archive ID.
streamIdThe stream ID.

◆ RemoveStreamFromBroadcast()

void OpenTokSDK.OpenTok.RemoveStreamFromBroadcast ( string  broadcastId,
string  streamId 
)

Removes a stream from a broadcast that was started with the the streamMode set to StreamMode.Manual.

Parameters
broadcastIdThe broadcast ID.
streamIdThe stream ID.
Exceptions
OpenTokArgumentException

◆ RemoveStreamFromBroadcastAsync()

Task OpenTokSDK.OpenTok.RemoveStreamFromBroadcastAsync ( string  broadcastId,
string  streamId 
)

Removes a stream from a broadcast that was started with the the streamMode set to StreamMode.Manual.

Parameters
broadcastIdThe broadcast ID.
streamIdThe stream ID.
Exceptions
OpenTokArgumentException

◆ SetArchiveLayout()

bool OpenTokSDK.OpenTok.SetArchiveLayout ( string  archiveId,
ArchiveLayout  layout 
)

Allows you to dynamically change the layout of a composed archive while it's being recorded see Customizing the video layout for composed archives for details regarding customizing a layout.

Parameters
archiveId
layout
Returns

◆ SetArchiveLayoutAsync()

async Task<bool> OpenTokSDK.OpenTok.SetArchiveLayoutAsync ( string  archiveId,
ArchiveLayout  layout 
)

Allows you to dynamically change the layout of a composed archive while it's being recorded see Customizing the video layout for composed archives for details regarding customizing a layout.

Parameters
archiveId
layout
Returns

◆ SetBroadcastLayout()

void OpenTokSDK.OpenTok.SetBroadcastLayout ( string  broadcastId,
BroadcastLayout  layout 
)

Sets the layout type for the broadcast. For a description of layout types, see Configuring the video layout for OpenTok live streaming broadcasts.

Parameters
broadcastIdThe broadcast ID of the broadcasting session.
layoutThe BroadcastLayout that defines layout options for the broadcast.

◆ SetBroadcastLayoutAsync()

async Task OpenTokSDK.OpenTok.SetBroadcastLayoutAsync ( string  broadcastId,
BroadcastLayout  layout 
)

Sets the layout type for the broadcast. For a description of layout types, see Configuring the video layout for OpenTok live streaming broadcasts.

Parameters
broadcastIdThe broadcast ID of the broadcasting session.
layoutThe BroadcastLayout that defines layout options for the broadcast.

◆ SetCustomUserAgent()

void OpenTokSDK.OpenTok.SetCustomUserAgent ( string  value)

Sets a custom user-agent value. The HttpClient will append this value, if it exists, to the initial user-agent value.

Parameters
valueThe custom user-agent value.

◆ SetDefaultRequestTimeout()

void OpenTokSDK.OpenTok.SetDefaultRequestTimeout ( int  timeout)

Set's the default request timeout (in milliseconds) for all WebRequest's sent by the SDK

Parameters
timeout

◆ SetStreamClassLists()

void OpenTokSDK.OpenTok.SetStreamClassLists ( string  sessionId,
List< StreamProperties streams 
)

Sets the layout class list for streams in a session. Layout classes are used in the layout for composed archives and live streaming broadcasts. For more information, see Customizing the video layout for composed archives and Configuring video layout for OpenTok live streaming broadcasts.

You can set the initial layout class list for streams published by a client when you generate used by the client. See the GenerateToken method.

Parameters
sessionIdThe sessionId
streamsA list of StreamsProperties that defines class lists for one or more streams in the session.

◆ SetStreamClassListsAsync()

async Task OpenTokSDK.OpenTok.SetStreamClassListsAsync ( string  sessionId,
List< StreamProperties streams 
)

Sets the layout class list for streams in a session. Layout classes are used in the layout for composed archives and live streaming broadcasts. For more information, see Customizing the video layout for composed archives and Configuring video layout for OpenTok live streaming broadcasts.

You can set the initial layout class list for streams published by a client when you generate used by the client. See the GenerateToken method.

Parameters
sessionIdThe sessionId
streamsA list of StreamsProperties that defines class lists for one or more streams in the session.

◆ Signal()

void OpenTokSDK.OpenTok.Signal ( string  sessionId,
SignalProperties  signalProperties,
string  connectionId = null 
)

Sends a signal to clients (or a specific client) connected to an Vonage Video API session.

Parameters
sessionIdThe Vonage Video API sessionId where the signal will be sent.
signalPropertiesThis signalProperties defines the payload for the signal.
connectionIdAn optional parameter used to send the signal to a specific connection in a session.

◆ SignalAsync()

async Task OpenTokSDK.OpenTok.SignalAsync ( string  sessionId,
SignalProperties  signalProperties,
string  connectionId = null 
)

Sends a signal to clients (or a specific client) connected to an Vonage Video API session.

Parameters
sessionIdThe Vonage Video API sessionId where the signal will be sent.
signalPropertiesThis signalProperties defines the payload for the signal.
connectionIdAn optional parameter used to send the signal to a specific connection in a session.

◆ StartArchive()

Archive OpenTokSDK.OpenTok.StartArchive ( string  sessionId,
string  name = "",
bool  hasVideo = true,
bool  hasAudio = true,
OutputMode  outputMode = OutputMode.COMPOSED,
string  resolution = null,
ArchiveLayout  layout = null,
StreamMode streamMode = null,
string  multiArchiveTag = null 
)

Starts archiving an Vonage Video API session.

Clients must be actively connected to the Vonage Video API session for you to successfully start recording an archive.

You can only record one archive at a time for a given session. You can only record archives of sessions that uses the Vonage Video API Media Router (sessions with the media mode set to routed); you cannot archive sessions with the media mode set to relayed.

Note that you can have the session be automatically archived by setting the archiveMode parameter of the CreateSession method to ArchiveMode.ALWAYS.

Parameters
sessionIdThe session ID of the Vonage Video API session to archive.
nameThe name of the archive. You can use this name to identify the archive. It is a property of the Archive object, and it is a property of archive-related events in the OpenTok client libraries.
hasVideoWhether the archive will record video (true) or not (false). The default value is true (video is recorded). If you set both hasAudio and hasVideo to false, the call to the StartArchive method results in an error.
hasAudioWhether the archive will record audio (true) or not (false). The default value is true (audio is recorded). If you set both hasAudio and hasVideo to false, the call to the StartArchive method results in an error.
outputModeWhether all streams in the archive are recorded to a single file (OutputMode.COMPOSED, the default) or to individual files (OutputMode.INDIVIDUAL).
resolutionThe resolution for the archive. The default for OutputMode.COMPOSED is "640x480". You cannot specify the resolution for OutputMode.INDIVIDUAL.
layoutThe layout that you want to use for your archive. If type is set to LayoutType.custom you must provide a StyleSheet string to Vonage how to layout your archive.
streamModeWhether streams included in the archive are selected automatically (StreamMode.Auto, the default) or manually (StreamMode.Manual). With StreamMode.Manual, you will specify streams to be included in the archive using the OpenTok.AddStreamToArchive and OpenTok.RemoveStreamFromArchive methods (or the OpenTok.AddStreamToArchiveAsync and OpenTok.RemoveStreamFromArchiveAsync methods).
multiArchiveTagSet this to support recording multiple archives for the same session simultaneously. Set this to a unique string for each simultaneous archive of an ongoing session. You must also set this option when manually starting an archive in a session that is automatically archived. If you do not specify a unique multiArchiveTag, you can only record one archive at a time for a given session. See Simultaneous archives.
Returns
The Archive object. This object includes properties defining the archive, including the archive ID.

◆ StartArchiveAsync()

async Task<Archive> OpenTokSDK.OpenTok.StartArchiveAsync ( string  sessionId,
string  name = "",
bool  hasVideo = true,
bool  hasAudio = true,
OutputMode  outputMode = OutputMode.COMPOSED,
string  resolution = null,
ArchiveLayout  layout = null,
StreamMode streamMode = null,
string  multiArchiveTag = null 
)

Starts archiving an Vonage Video API session.

Clients must be actively connected to the Vonage Video API session for you to successfully start recording an archive.

You can only record one archive at a time for a given session. You can only record archives of sessions that uses the Vonage Video API Media Router (sessions with the media mode set to routed); you cannot archive sessions with the media mode set to relayed.

Note that you can have the session be automatically archived by setting the archiveMode parameter of the CreateSession method to ArchiveMode.ALWAYS.

Parameters
sessionIdThe session ID of the Vonage Video API session to archive.
nameThe name of the archive. You can use this name to identify the archive. It is a property of the Archive object, and it is a property of archive-related events in the OpenTok client libraries.
hasVideoWhether the archive will record video (true) or not (false). The default value is true (video is recorded). If you set both hasAudio and hasVideo to false, the call to the StartArchive method results in an error.
hasAudioWhether the archive will record audio (true) or not (false). The default value is true (audio is recorded). If you set both hasAudio and hasVideo to false, the call to the StartArchive method results in an error.
outputModeWhether all streams in the archive are recorded to a single file (OutputMode.COMPOSED, the default) or to individual files (OutputMode.INDIVIDUAL).
resolutionThe resolution for the archive. The default for OutputMode.COMPOSED is "640x480". You cannot specify the resolution for OutputMode.INDIVIDUAL.
layoutThe layout that you want to use for your archive. If type is set to LayoutType.custom you must provide a StyleSheet string to Vonage how to layout your archive.
streamModeWhether streams included in the archive are selected automatically (StreamMode.Auto, the default) or manually (StreamMode.Manual). With StreamMode.Manual, you will specify streams to be included in the archive using the OpenTok.AddStreamToArchive and OpenTok.RemoveStreamFromArchive methods (or the OpenTok.AddStreamToArchiveAsync and OpenTok.RemoveStreamFromArchiveAsync methods).
multiArchiveTagSet this to support recording multiple archives for the same session simultaneously. Set this to a unique string for each simultaneous archive of an ongoing session. You must also set this option when manually starting an archive in a session that is automatically archived. If you do not specify a unique multiArchiveTag, you can only record one archive at a time for a given session. See Simultaneous archives.
Returns
The Archive object. This object includes properties defining the archive, including the archive ID.

◆ StartAudioConnectorAsync()

async Task<AudioConnector> OpenTokSDK.OpenTok.StartAudioConnectorAsync ( AudioConnectorStartRequest  request)

Sends audio from a Vonage Video API session to a WebSocket. For more information, see the Audio Connector developer guide.

Parameters
requestThe request to start the audio connector.
Returns
The response object from the server.

◆ StartBroadcast()

Broadcast OpenTokSDK.OpenTok.StartBroadcast ( string  sessionId,
bool  hls = true,
List< Rtmp rtmpList = null,
string  resolution = null,
int  maxDuration = 7200,
BroadcastLayout  layout = null,
StreamMode streamMode = null,
bool  dvr = false,
bool?  lowLatency = null,
string  multiBroadcastTag = null,
bool  hasAudio = true,
bool  hasVideo = true 
)

Use this method to start a live streaming for an Vonage Video API session. This broadcasts the session to an HLS (HTTP live streaming) or to RTMP streams.

To successfully start broadcasting a session, at least one client must be connected to the session.

You can only have one active live streaming broadcast at a time for a session (however, having more than one would not be useful). The live streaming broadcast can target one HLS endpoint and up to five RTMP servers simultaneously for a session. You can only start live streaming for sessions that use the Vonage Video API Media Router (with the media mode set to routed); you cannot use live streaming with sessions that have the media mode set to relayed Vonage Video API Media Router. See The OpenTok Media Router and media modes.

For more information on broadcasting, see the Broadcast developer guide.

Parameters
sessionIdThe session ID corresponding to the session.
hlsWhether to include an HLS broadcast.
rtmpListA list of Rtmp objects, defining RTMP streams to be broadcast (up to five).
resolutionThe resolution of the broadcast video. Valid resolutions are "640x480", "1280x720", "1920x1080", "480x640", "720x1280", "1080x1920".
maxDurationThe maximum duration for the broadcast, in seconds. The broadcast will automatically stop when the maximum duration is reached. You can set the maximum duration to a value from 60 (60 seconds) to 36000 (10 hours). The default maximum duration is 2 hours (7,200 seconds).
layoutSpecify this BroadcastLayout object to assign the initial layout type for the broadcast.
streamModeWhether streams included in the broadcast are selected automatically (StreamMode.Auto, the default) or manually (StreamMode.Manual). With StreamMode.Manual, you will specify streams to be included in the broadcast using the OpenTok.AddStreamToBroadcast and OpenTok.RemoveStreamFromBroadcast methods (or the OpenTok.AddStreamToBroadcastAsync and OpenTok.RemoveStreamFromBroadcastAsync methods).
dvrWhether to enable DVR functionality — rewinding, pausing, and resuming — in players that support it (true), or not (false, the default). With DVR enabled, the HLS URL will include a ?DVR query string appended to the end. See DVR functionality
lowLatencyWhether to enable low-latency mode for the HLSstream. Some HLS players do not support low-latency mode. This feature is incompatible with DVR mode HLS broadcasts. See Low-latency HLS broadcasts
multiBroadcastTagSet this to support multiple broadcasts for the same session simultaneously. Set this to a unique string for each simultaneous broadcast of an ongoing session. See Simultaneous broadcasts.
hasAudioWhether the broadcast has audio (default is true).
hasVideoWhether the broadcast has video (default is true).
Returns
The Broadcast object. This object includes properties defining the archive, including the archive ID.

◆ StartBroadcastAsync()

async Task<Broadcast> OpenTokSDK.OpenTok.StartBroadcastAsync ( string  sessionId,
bool  hls = true,
List< Rtmp rtmpList = null,
string  resolution = null,
int  maxDuration = 7200,
BroadcastLayout  layout = null,
StreamMode streamMode = null,
bool  dvr = false,
bool?  lowLatency = null,
string  multiBroadcastTag = null,
bool  hasAudio = true,
bool  hasVideo = true 
)

Use this method to start a live streaming for an Vonage Video API session. This broadcasts the session to an HLS (HTTP live streaming) or to RTMP streams.

To successfully start broadcasting a session, at least one client must be connected to the session.

You can only have one active live streaming broadcast at a time for a session (however, having more than one would not be useful). The live streaming broadcast can target one HLS endpoint and up to five RTMP servers simultaneously for a session. You can only start live streaming for sessions that use the Vonage Video API Media Router (with the media mode set to routed); you cannot use live streaming with sessions that have the media mode set to relayed Vonage Video API Media Router. See The OpenTok Media Router and media modes.

For more information on broadcasting, see the Broadcast developer guide.

Parameters
sessionIdThe session ID corresponding to the session.
hlsWhether to include an HLS broadcast.
rtmpListA list of Rtmp objects, defining RTMP streams to be broadcast (up to five).
resolutionThe resolution of the broadcast video. Valid resolutions are "640x480", "1280x720", "1920x1080", "480x640", "720x1280", "1080x1920".
maxDurationThe maximum duration for the broadcast, in seconds. The broadcast will automatically stop when the maximum duration is reached. You can set the maximum duration to a value from 60 (60 seconds) to 36000 (10 hours). The default maximum duration is 2 hours (7,200 seconds).
layoutSpecify this BroadcastLayout object to assign the initial layout type for the broadcast.
streamModeWhether streams included in the broadcast are selected automatically (StreamMode.Auto, the default) or manually (StreamMode.Manual). With StreamMode.Manual, you will specify streams to be included in the broadcast using the OpenTok.AddStreamToBroadcast and OpenTok.RemoveStreamFromBroadcast methods (or the OpenTok.AddStreamToBroadcastAsync and OpenTok.RemoveStreamFromBroadcastAsync methods).
dvrWhether to enable DVR functionality — rewinding, pausing, and resuming — in players that support it (true), or not (false, the default). With DVR enabled, the HLS URL will include a ?DVR query string appended to the end. See DVR functionality
lowLatencyWhether to enable low-latency mode for the HLSstream. Some HLS players do not support low-latency mode. This feature is incompatible with DVR mode HLS broadcasts. See Low-latency HLS broadcasts
multiBroadcastTagSet this to support multiple broadcasts for the same session simultaneously. Set this to a unique string for each simultaneous broadcast of an ongoing session. See Simultaneous broadcasts.
hasAudioWhether the broadcast has audio (default is true).
hasVideoWhether the broadcast has video (default is true).
Returns
The Broadcast object. This object includes properties defining the archive, including the archive ID.

◆ StartRenderAsync()

async Task<RenderItem> OpenTokSDK.OpenTok.StartRenderAsync ( StartRenderRequest  request)

Starts a new Experience Composer renderer for an Vonage Video API session.

For more information, see the . Experience Composer developer guide.

Parameters
requestThe rendering request.
Returns
The generated rendering.

◆ StopArchive()

Archive OpenTokSDK.OpenTok.StopArchive ( string  archiveId)

Stops an OpenTok archive that is being recorded.

Archives automatically stop recording after 120 minutes or when all clients have disconnected from the session being archived.

Parameters
archiveIdThe archive ID of the archive you want to stop recording.
Returns
The Archive object corresponding to the archive being stopped.

◆ StopArchiveAsync()

async Task<Archive> OpenTokSDK.OpenTok.StopArchiveAsync ( string  archiveId)

Stops an OpenTok archive that is being recorded.

Archives automatically stop recording after 120 minutes or when all clients have disconnected from the session being archived.

Parameters
archiveIdThe archive ID of the archive you want to stop recording.
Returns
The Archive object corresponding to the archive being stopped.

◆ StopAudioConnectorAsync()

async Task OpenTokSDK.OpenTok.StopAudioConnectorAsync ( string  connectionId)

Stops sending audio for a Vonage Video API session.

Parameters
connectionIdThe OpenTok connection ID for the Audio Connector WebSocket connection in the Vonage Video API session. See AudioConnector.ConnectionId.

◆ StopBroadcast()

Broadcast OpenTokSDK.OpenTok.StopBroadcast ( string  broadcastId)

Use this method to stop a live broadcast of an Vonage Video API session. Note that broadcasts automatically stop 120 minutes after they are started.

For more information on broadcasting, see the Broadcast developer guide.

Parameters
broadcastIdThe broadcast ID of the broadcasting session
Returns
The Broadcast object. This object includes properties defining the broadcast, including the broadcast ID.

◆ StopBroadcastAsync()

async Task<Broadcast> OpenTokSDK.OpenTok.StopBroadcastAsync ( string  broadcastId)

Use this method to stop a live broadcast of an Vonage Video API session. Note that broadcasts automatically stop 120 minutes after they are started.

For more information on broadcasting, see the Broadcast developer guide.

Parameters
broadcastIdThe broadcast ID of the broadcasting session
Returns
The Broadcast object. This object includes properties defining the broadcast, including the broadcast ID.

◆ StopRenderAsync()

async Task OpenTokSDK.OpenTok.StopRenderAsync ( string  renderId)

Stops an Experience Composer renderer.

Parameters
renderIdThe Id of the rendering.

Property Documentation

◆ ApiKey

int OpenTokSDK.OpenTok.ApiKey

The Vonage Video API key passed into the OpenTok() constructor.

◆ ApiSecret

string OpenTokSDK.OpenTok.ApiSecret

The Vonage Video API secret passed into the OpenTok() constructor.

◆ Client

HttpClient OpenTokSDK.OpenTok.Client

For internal use

◆ Debug

bool OpenTokSDK.OpenTok.Debug

Enables writing request/response details to console. Don't use in a production environment.