Contains methods for creating Vonage Video API sessions, generating tokens, and working with archives. More...
Public Member Functions | |
async Task< AudioConnector > | StartAudioConnectorAsync (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... | |
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) |
Creates a new Vonage Video API session. More... | |
async Task< Session > | CreateSessionAsync (string location="", MediaMode mediaMode=MediaMode.RELAYED, ArchiveMode archiveMode=ArchiveMode.MANUAL, bool encryption=false) |
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< Archive > | 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. More... | |
Archive | StopArchive (string archiveId) |
Stops an OpenTok archive that is being recorded. More... | |
async Task< Archive > | StopArchiveAsync (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< ArchiveList > | 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. More... | |
Archive | GetArchive (string archiveId) |
Gets an Archive object for the given archive ID. More... | |
async Task< Archive > | GetArchiveAsync (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< Stream > | GetStreamAsync (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< StreamList > | ListStreamsAsync (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) |
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< Broadcast > | 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) |
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< Broadcast > | 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. More... | |
Broadcast | GetBroadcast (string broadcastId) |
Use this method to get a live streaming broadcast object of an Vonage Video API session. More... | |
async Task< Broadcast > | GetBroadcastAsync (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< Sip > | DialAsync (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< RenderItem > | StartRenderAsync (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< ListRendersResponse > | ListRendersAsync (ListRendersRequest request) |
Retrieves all Experience Composer renderers matching the provided request. More... | |
async Task< RenderItem > | GetRenderAsync (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... |
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.
OpenTokSDK.OpenTok.OpenTok | ( | int | apiKey, |
string | apiSecret | ||
) |
Creates an OpenTok object.
apiKey | Your Vonage Video API key. (See the TokBox account page |
apiSecret | Your Vonage Video API secret. (See the TokBox account page |
OpenTokSDK.OpenTok.OpenTok | ( | int | apiKey, |
string | apiSecret, | ||
string | apiUrl | ||
) |
For TokBox internal use.
apiKey | |
apiSecret | |
apiUrl |
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.
archiveId | The archive ID. |
streamId | The stream ID. |
hasAudio | Whether the composed archive should include the stream's audio (true, the default) or not (false). |
hasVideo | Whether the composed archive should include the stream's video (true, the default) or not (false). |
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.
archiveId | The archive ID. |
streamId | The stream ID. |
hasAudio | Whether the composed archive should include the stream's audio (true, the default) or not (false). |
hasVideo | Whether the composed archive should include the stream's video (true, the default) or not (false). |
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.
broadcastId | The broadcast ID. |
streamId | The stream ID. |
hasAudio | Whether the broadcast should include the stream's audio (true, the default) or not (false). |
hasVideo | Whether the broadcast should include the stream's video (true, the default) or not (false). |
OpenTokArgumentException |
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.
broadcastId | The broadcast ID. |
streamId | The stream ID. |
hasAudio | Whether the broadcast should include the stream's audio (true, the default) or not (false). |
hasVideo | Whether the broadcast should include the stream's video (true, the default) or not (false). |
OpenTokArgumentException |
Session OpenTokSDK.OpenTok.CreateSession | ( | string | location = "" , |
MediaMode | mediaMode = MediaMode.RELAYED , |
||
ArchiveMode | archiveMode = ArchiveMode.MANUAL , |
||
bool | encryption = false |
||
) |
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.
location | An 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. |
mediaMode | Whether 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:
archiveMode | Whether 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 |
encryption | Enables end-to-end media encryption in routed sessions. |
async Task<Session> OpenTokSDK.OpenTok.CreateSessionAsync | ( | string | location = "" , |
MediaMode | mediaMode = MediaMode.RELAYED , |
||
ArchiveMode | archiveMode = ArchiveMode.MANUAL , |
||
bool | encryption = false |
||
) |
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.
location | An 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. |
mediaMode | Whether 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:
archiveMode | Whether 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 |
encryption | Enables end-to-end media encryption in routed sessions. |
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.
archiveId | The archive ID of the archive you want to delete. |
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.
archiveId | The archive ID of the archive you want to delete. |
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.
sessionId | The session ID corresponding to the session to which the user will connect. |
token | The token for the session ID with which the SIP user will use to connect. |
sipUri | The 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" . |
options | Optional parameters for SIP dialing. |
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.
sessionId | The session ID corresponding to the session to which the user will connect. |
token | The token for the session ID with which the SIP user will use to connect. |
sipUri | The 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" . |
options | Optional parameters for SIP dialing. |
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.
sessionId | The session ID. |
OpenTokArgumentException | Thrown when the session ID is invalid. |
OpenTokWebException | Thrown when an HTTP error has occurred. |
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.
sessionId | The session ID. |
OpenTokArgumentException | Thrown when the session ID is invalid. |
OpenTokWebException | Thrown when an HTTP error has occurred. |
void OpenTokSDK.OpenTok.ForceDisconnect | ( | string | sessionId, |
string | connectionId | ||
) |
Force a specific client to disconnect from an Vonage Video API session.
sessionId | The session ID corresponding to the session. |
connectionId | The connectionId of the connection in a session. |
async Task OpenTokSDK.OpenTok.ForceDisconnectAsync | ( | string | sessionId, |
string | connectionId | ||
) |
Force a specific client to disconnect from an Vonage Video API session.
sessionId | The session ID corresponding to the session. |
connectionId | The connectionId of the connection in a session. |
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.
sessionId | The ID of session. |
excludedStreamIds | The stream IDs of streams that will not be muted. |
OpenTokArgumentException | Thrown when the session ID is invalid. |
OpenTokWebException | Thrown when an HTTP error has occurred. |
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.
sessionId | The ID of session. |
excludedStreamIds | The stream IDs of streams that will not be muted. |
OpenTokArgumentException | Thrown when the session ID is invalid. |
OpenTokWebException | Thrown when an HTTP error has occurred. |
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.
sessionId | The session ID of the session that includes the stream. |
streamId | The stream ID. |
OpenTokArgumentException | Thrown when session or stream ID is invalid. |
OpenTokWebException | Thrown when an HTTP error has occurred. |
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.
sessionId | The session ID of the session that includes the stream. |
streamId | The stream ID. |
OpenTokArgumentException | Thrown when session or stream ID is invalid. |
OpenTokWebException | Thrown when an HTTP error has occurred. |
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.
sessionId | The session ID corresponding to the session to which the user will connect. |
role | The role for the token. Valid values are defined in the Role enum:
|
expireTime | The 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. |
data | A 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. |
initialLayoutClassList | A list of strings values containing the initial layout for the stream. |
Archive OpenTokSDK.OpenTok.GetArchive | ( | string | archiveId | ) |
async Task<Archive> OpenTokSDK.OpenTok.GetArchiveAsync | ( | string | archiveId | ) |
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.
broadcastId | The broadcast ID of the broadcasting session |
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.
broadcastId | The broadcast ID of the broadcasting session |
async Task<RenderItem> OpenTokSDK.OpenTok.GetRenderAsync | ( | string | renderId | ) |
Retrieves an Experience Composer renderer.
renderId | The Id of the rendering. |
Stream OpenTokSDK.OpenTok.GetStream | ( | string | sessionId, |
string | streamId | ||
) |
async Task<Stream> OpenTokSDK.OpenTok.GetStreamAsync | ( | string | sessionId, |
string | streamId | ||
) |
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.
offset | The 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. |
count | The number of archives to be returned. The maximum number of archives returned is 1000. |
sessionId | The session ID. |
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.
offset | The 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. |
count | The number of archives to be returned. The maximum number of archives returned is 1000. |
sessionId | The session ID. |
async Task<ListRendersResponse> OpenTokSDK.OpenTok.ListRendersAsync | ( | ListRendersRequest | request | ) |
Retrieves all Experience Composer renderers matching the provided request.
request | The request containing filtering options. |
StreamList OpenTokSDK.OpenTok.ListStreams | ( | string | sessionId | ) |
async Task<StreamList> OpenTokSDK.OpenTok.ListStreamsAsync | ( | string | sessionId | ) |
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.
sessionId | The session ID corresponding to the session that will receive the DTMF string. |
connectionId | The 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. |
digits | This 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). |
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.
sessionId | The session ID corresponding to the session that will receive the DTMF string. |
connectionId | The 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. |
digits | This 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). |
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.
archiveId | The archive ID. |
streamId | The stream ID. |
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.
archiveId | The archive ID. |
streamId | The stream ID. |
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.
broadcastId | The broadcast ID. |
streamId | The stream ID. |
OpenTokArgumentException |
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.
broadcastId | The broadcast ID. |
streamId | The stream ID. |
OpenTokArgumentException |
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.
archiveId | |
layout |
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.
archiveId | |
layout |
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.
broadcastId | The broadcast ID of the broadcasting session. |
layout | The BroadcastLayout that defines layout options for the broadcast. |
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.
broadcastId | The broadcast ID of the broadcasting session. |
layout | The BroadcastLayout that defines layout options for the broadcast. |
void OpenTokSDK.OpenTok.SetDefaultRequestTimeout | ( | int | timeout | ) |
Set's the default request timeout (in milliseconds) for all WebRequest's sent by the SDK
timeout |
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.
sessionId | The sessionId |
streams | A list of StreamsProperties that defines class lists for one or more streams in the session. |
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.
sessionId | The sessionId |
streams | A list of StreamsProperties that defines class lists for one or more streams in the session. |
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.
sessionId | The Vonage Video API sessionId where the signal will be sent. |
signalProperties | This signalProperties defines the payload for the signal. |
connectionId | An optional parameter used to send the signal to a specific connection in a session. |
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.
sessionId | The Vonage Video API sessionId where the signal will be sent. |
signalProperties | This signalProperties defines the payload for the signal. |
connectionId | An optional parameter used to send the signal to a specific connection in a session. |
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.
sessionId | The session ID of the Vonage Video API session to archive. |
name | The 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. |
hasVideo | Whether 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. |
hasAudio | Whether 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. |
outputMode | Whether all streams in the archive are recorded to a single file (OutputMode.COMPOSED, the default) or to individual files (OutputMode.INDIVIDUAL). |
resolution | The resolution for the archive. The default for OutputMode.COMPOSED is "640x480". You cannot specify the resolution for OutputMode.INDIVIDUAL. |
layout | The 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. |
streamMode | Whether 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). |
multiArchiveTag | Set 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. |
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.
sessionId | The session ID of the Vonage Video API session to archive. |
name | The 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. |
hasVideo | Whether 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. |
hasAudio | Whether 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. |
outputMode | Whether all streams in the archive are recorded to a single file (OutputMode.COMPOSED, the default) or to individual files (OutputMode.INDIVIDUAL). |
resolution | The resolution for the archive. The default for OutputMode.COMPOSED is "640x480". You cannot specify the resolution for OutputMode.INDIVIDUAL. |
layout | The 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. |
streamMode | Whether 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). |
multiArchiveTag | Set 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. |
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.
request | The request to start the audio connector. |
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 |
||
) |
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.
sessionId | The session ID corresponding to the session. |
hls | Whether to include an HLS broadcast. |
rtmpList | A list of Rtmp objects, defining RTMP streams to be broadcast (up to five). |
resolution | The resolution of the broadcast video. Valid resolutions are "640x480", "1280x720", "1920x1080", "480x640", "720x1280", "1080x1920". |
maxDuration | The 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). |
layout | Specify this BroadcastLayout object to assign the initial layout type for the broadcast. |
streamMode | Whether 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). |
dvr | Whether 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 |
lowLatency | Whether 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 |
multiBroadcastTag | Set 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. |
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 |
||
) |
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.
sessionId | The session ID corresponding to the session. |
hls | Whether to include an HLS broadcast. |
rtmpList | A list of Rtmp objects, defining RTMP streams to be broadcast (up to five). |
resolution | The resolution of the broadcast video. Valid resolutions are "640x480", "1280x720", "1920x1080", "480x640", "720x1280", "1080x1920". |
maxDuration | The 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). |
layout | Specify this BroadcastLayout object to assign the initial layout type for the broadcast. |
streamMode | Whether 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). |
dvr | Whether 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 |
lowLatency | Whether 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 |
multiBroadcastTag | Set 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. |
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.
request | The rendering request. |
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.
archiveId | The archive ID of the archive you want to stop recording. |
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.
archiveId | The archive ID of the archive you want to stop recording. |
async Task OpenTokSDK.OpenTok.StopAudioConnectorAsync | ( | string | connectionId | ) |
Stops sending audio for a Vonage Video API session.
connectionId | The OpenTok connection ID for the Audio Connector WebSocket connection in the Vonage Video API session. See AudioConnector.ConnectionId. |
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.
broadcastId | The broadcast ID of the broadcasting session |
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.
broadcastId | The broadcast ID of the broadcasting session |
async Task OpenTokSDK.OpenTok.StopRenderAsync | ( | string | renderId | ) |
Stops an Experience Composer renderer.
renderId | The Id of the rendering. |
|
The Vonage Video API key passed into the OpenTok() constructor.
|
The Vonage Video API secret passed into the OpenTok() constructor.
|
For internal use
|
Enables writing request/response details to console. Don't use in a production environment.