Represents an Vonage Video API session. Use the OpenTok.CreateSession method of the OpenTok class to create an Vonage Video API session. Use the Id property of the Session object to get the session ID.
More...
|
string | GenerateToken (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 that user must pass an authentication token along with the API key. More...
|
Represents an Vonage Video API session. Use the OpenTok.CreateSession method of the OpenTok class to create an Vonage Video API session. Use the Id property of the Session object to get the session ID.
◆ GenerateToken()
string OpenTokSDK.Session.GenerateToken |
( |
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 that user must pass an authentication token along with the API key.
- Parameters
-
role | The 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, in clients using the OpenTok.js library, a moderator can call the forceUnpublish() and forceDisconnect() method of the Session object.
|
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 | |
- Returns
- The token string.
◆ ApiKey
int OpenTokSDK.Session.ApiKey |
|
Your Vonage Video API key.
◆ ApiSecret
string OpenTokSDK.Session.ApiSecret |
|
Your Vonage Video API secret.
◆ ArchiveMode
◆ Id
string OpenTokSDK.Session.Id |
|
The session ID, which uniquely identifies the session.
◆ Location
string OpenTokSDK.Session.Location |
|
The location hint IP address.
◆ MediaMode
Defines whether the session will transmit streams using the Vonage Video API Media Router (MediaMode.ROUTED) or attempt to transmit streams directly between clients (MediaMode.RELAYED).