Bases: object
Represents an archive of an OpenTok session.
Variables: |
|
---|
Returns a dictionary of the archive’s attributes.
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.
Returns a JSON representation of the archive.
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.
Bases: object
Bases: enum.Enum
List of valid settings for the output_mode parameter of the OpenTok.start_archive() method.
All streams in the archive are recorded to a single (composed) file.
Each stream in the archive is recorded to an individual file.
Bases: object
For internal use. Class that provides the endpoint urls
this method returns urls for working with broadcast
this method returns the url to initialize a SIP call
this method returns the force disconnect url endpoint
this method returns the url to get streams information
this method returns the url to set the archive layout
this method returns the url to set the stream class list
Bases: opentok.exceptions.OpenTokException
Indicates that there was a archive specific problem, probably the status of the requested archive is invalid.
Bases: opentok.exceptions.OpenTokException
Indicates that the problem was likely with credentials. Check your API key and API secret and try again.
Bases: opentok.exceptions.OpenTokException
Indicates that data in your request data is invalid JSON. It may also indicate that you passed in invalid layout options. Or you have exceeded the limit of five simultaneous RTMP streams for an OpenTok session. Or you specified and invalid resolution. Or The broadcast has already started for the session
Bases: opentok.exceptions.OpenTokException
Indicates that there was a force disconnect specific problem: One of the arguments is invalid or the client specified by the connectionId property is not connected to the session
Bases: opentok.exceptions.OpenTokException
Indicates that the data in the request is invalid, or the session_id or stream_id are invalid
Bases: opentok.exceptions.OpenTokException
Indicates that the element requested was not found. Check the parameters of the request.
Bases: exceptions.Exception
Defines exceptions thrown by the OpenTok SDK.
Bases: opentok.exceptions.OpenTokException
Indicates an error during the request. Most likely an error connecting to the OpenTok API servers. (HTTP 500 error).
Bases: opentok.exceptions.OpenTokException
Indicates that there is invalid data in the JSON request. It may also indicate that invalid layout options have been passed
Bases: opentok.exceptions.OpenTokException
Indicates that there was a signaling specific problem, one of the parameter is invalid or the type|data string doesn’t have a correct size
Bases: opentok.exceptions.OpenTokException
Indicates that there was a SIP dial specific problem: The Session ID passed in is invalid or you attempt to start a SIP call for a session that does not use the OpenTok Media Router.
Bases: enum.Enum
List of valid settings for the archive_mode parameter of the OpenTok.create_Session() method.
The session will be automatically archived.
The session will be manually archived.
Bases: enum.Enum
List of valid settings for the mediaMode parameter of the OpenTok.create_session() method.
The session will attempt to transmit streams directly between clients. If two clients cannot send and receive each others’ streams, due to firewalls on the clients’ networks, their streams will be relayed using the OpenTok TURN Server.
The session will transmit streams using the OpenTok Media Server.
Bases: object
Use this SDK to create tokens and interface with the server-side portion of the Opentok API.
For internal use.
Creates a new OpenTok session and returns the session ID, which uniquely identifies the session.
For example, when using the OpenTok JavaScript library, use the session ID when calling the OT.initSession() method (to initialize an OpenTok session).
OpenTok 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 the OpenTok dashboard.
Parameters: |
|
---|---|
Return type: | The Session object. The session_id property of the object is the session ID. |
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: | archive_id (String) – The archive ID of the archive to be deleted. |
---|
Use this method to connect a SIP platform to an OpenTok session. The audio from the end of the SIP call is added to the OpenTok session as an audio-only stream. The OpenTok Media Router mixes audio from other streams in the session and sends the mixed audio to the SIP endpoint
Parameters: |
|
---|
OpenTok to the SIP platform
Parameters: | options optional (Dictionary) – Aditional options with the following properties: String ‘from’: The number or string that will be sent to the final SIP number as the caller Dictionary ‘headers’: Defines custom headers to be added to the SIP INVITE request initiated from OpenTok to the SIP platform Dictionary ‘auth’: Contains the username and password to be used in the the SIP INVITE request for HTTP digest authentication, if it is required by the SIP platform For example:
Boolean ‘secure’: A Boolean flag that indicates whether the media must be transmitted encrypted (true) or not (false, the default) |
---|---|
Return type: | A SipCall object, which contains data of the SIP call: id, connectionId and streamId |
Sends a request to disconnect a client from an OpenTok session
Parameters: | session_id (String) – The session ID of the OpenTok session from which the |
---|
client will be disconnected
Parameters: | connection_id (String) – The connection ID of the client that will be disconnected |
---|
Generates a token for a given session.
Parameters: |
|
---|---|
Return type: | The token string. |
Gets an Archive object for the given archive ID.
Parameters: | archive_id (String) – The archive ID. |
---|---|
Return type: | The Archive object. |
Returns an ArchiveList, which is an array of archives that are completed and in-progress, for your API key.
Parameters: |
|
---|---|
Return type: | An ArchiveList object, which is an array of Archive objects. |
Use this method to get details on a broadcast that is in-progress.
Parameters: | broadcast_id (String) – The ID of the broadcast you want to stop |
---|---|
Rtype A Broadcast object, which contains information of the broadcast: | |
id, sessionId |
projectId, createdAt, updatedAt, resolution, broadcastUrls and status
Returns an Stream object that contains information of an OpenTok stream:
-id: The stream ID -videoType: “camera” or “screen” -name: The stream name (if one was set when the client published the stream) -layoutClassList: It’s an array of the layout classes for the stream
For internal use.
For internal use.
New method to get archive list, it’s alternative to ‘get_archives()’, both methods exist to have backwards compatible
Returns a list of Stream objects that contains information of all the streams in a OpenTok session, with the following attributes:
-count: An integer that indicates the number of streams in the session -items: List of the Stream objects
Use this method to change the layout of videos in an OpenTok archive
Parameters: |
|
---|
‘bestFit’, ‘custom’, ‘horizontalPresentation’, ‘pip’ and ‘verticalPresentation’
Parameters: | stylesheet optional (String) – CSS used to style the custom layout. |
---|
Specify this only if you set the type property to ‘custom’
Use this method to change the layout type of a live streaming broadcast
Parameters: |
|
---|
‘bestFit’, ‘custom’, ‘horizontalPresentation’, ‘pip’ and ‘verticalPresentation’
Parameters: | stylesheet optional (String) – CSS used to style the custom layout. |
---|
Specify this only if you set the type property to ‘custom’
Use this method to change layout classes for OpenTok streams. The layout classes define how the streams are displayed in the layout of a composed OpenTok archive
Parameters: |
|
---|
Each element in the list is a dictionary with two properties: ‘id’ and ‘layoutClassList’. The ‘id’ property is the stream ID (a String), and the ‘layoutClassList’ is an array of class names (Strings) to apply to the stream. For example:
- payload = [
- {‘id’: ‘7b09ec3c-26f9-43d7-8197-f608f13d4fb6’, ‘layoutClassList’: [‘focus’]}, {‘id’: ‘567bc941-6ea0-4c69-97fc-70a740b68976’, ‘layoutClassList’: [‘top’]}, {‘id’: ‘307dc941-0450-4c09-975c-705740d08970’, ‘layoutClassList’: [‘bottom’]}
]
Send signals to all participants in an active OpenTok session or to a specific client connected to that session.
Parameters: |
|
---|
correspond to the type and data parameters passed in the client signal received handlers
Parameters: | connection_id (String) – The connection_id parameter is an optional string used to |
---|
specify the connection ID of a client connected to the session. If you specify this value, the signal is sent to the specified client. Otherwise, the signal is sent to all clients connected to the session
Starts archiving an OpenTok session.
Clients must be actively connected to the OpenTok 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 use the OpenTok Media Router (sessions with the media mode set to routed); you cannot archive sessions with the media mode set to relayed.
For more information on archiving, see the OpenTok archiving programming guide.
Parameters: |
|
---|---|
Return type: | The Archive object, which includes properties defining the archive, including the archive ID. |
Use this method to start a live streaming for an OpenTok 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 start live streaming for sessions that use the OpenTok Media Router (with the media mode set to routed); you cannot use live streaming with sessions that have the media mode set to relayed
Parameters: |
|
---|---|
Rtype A Broadcast object, which contains information of the broadcast: | |
id, sessionId |
projectId, createdAt, updatedAt, resolution, status and broadcastUrls
Stops an OpenTok archive that is being recorded.
Archives automatically stop recording after 90 minutes or when all clients have disconnected from the session being archived.
@param [String] archive_id The archive ID of the archive you want to stop recording.
Return type: | The Archive object corresponding to the archive being stopped. |
---|
Use this method to stop a live broadcast of an OpenTok session
Parameters: | broadcast_id (String) – The ID of the broadcast you want to stop |
---|---|
Rtype A Broadcast object, which contains information of the broadcast: | |
id, sessionId |
projectId, createdAt, updatedAt and resolution
Bases: enum.Enum
List of valid roles for a token.
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.
A publisher can publish streams, subscribe to streams, and signal
A subscriber can only subscribe to streams.
Bases: object
Represents an OpenTok session.
Use the OpenTok.create_session() method to create an OpenTok session. Use the session_id property of the Session object to get the session ID.
Variables: | session_id (String) – The session ID. |
---|
Generates a token for the session.
Parameters: |
|
---|---|
Return type: | The token string. |
Bases: object
Represents an OpenTok stream
Returns a dictionary of the Stream’s attributes.
Returns a JSON representation of the Stream.
Bases: object
Represents a list of OpenTok stream objects