OpenVidu

OpenVidu class.

class pyopenvidu.openvidu.OpenVidu(url: str, secret: str, initial_fetch: bool = True, timeout: Union[int, tuple, None] = None, verify: Union[str, bool, None] = None, cert: Union[tuple, str, None] = None)[source]

Bases: object

This object represents a OpenVidu server instance.

Parameters:
create_session(custom_session_id: str = None, media_mode: str = None) → pyopenvidu.openvidusession.OpenViduSession[source]

Creates a new OpenVidu session.

https://docs.openvidu.io/en/2.16.0/reference-docs/REST-API/#post-openviduapisessions

Parameters:
  • custom_session_id – You can fix the sessionId that will be assigned to the session with this parameter.
  • media_mode – ROUTED (default) or RELAYED
Returns:

The created OpenViduSession instance.

fetch() → bool[source]

Updates every property of every active Session with the current status they have in OpenVidu Server. After calling this method you can access the updated list of active sessions through the sessions property.

Returns:true if the Session status has changed with respect to the server, false if not. This applies to any property or sub-property of the object.
get_config() → dict[source]

Get OpenVidu active configuration.

Unlike session related calls. This call does not require prior calling of the fetch() method. Using this function will always result an API call to the backend.

https://docs.openvidu.io/en/2.16.0/reference-docs/REST-API/#get-openviduapiconfig

Returns:The exact response from the server as a dict.
get_session(session_id: str) → pyopenvidu.openvidusession.OpenViduSession[source]

Get a currently active session to the server.

Parameters:session_id – The ID of the session to acquire.
Returns:An OpenViduSession object.
session_count

Get the number of active sessions on the server.

Returns:The number of active sessions.
sessions

Get a list of currently active sessions to the server.

Returns:A list of OpenViduSession objects.