OpenViduConnection

OpenViduConnection class.

class pyopenvidu.openviduconnection.OpenViduConnection(session: requests_toolbelt.sessions.BaseUrlSession, data: dict)[source]

Bases: object

This is a base class for connection objects.

Direct instantiation of this class is not supported! Use OpenViduSession.connections to get an instance of this class.

fetch() → bool[source]

Updates every property of the connection object.

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

Forces the disconnection from the session. Remember to call fetch() after this call to fetch the current properties of the Session from OpenVidu Server!

https://docs.openvidu.io/en/2.16.0/reference-docs/REST-API/#delete-openviduapisessionsltsession_idgtconnectionltconnection_idgt

force_unpublish_all_streams()[source]

Forces the user to unpublish all of their Stream. OpenVidu Browser will trigger the proper events on the client-side (streamDestroyed) with reason set to “forceUnpublishByServer”. After this call, the instance of the object, should be considered invalid. Remember to call fetch() after this call to fetch the actual properties of the Session from OpenVidu Server!

https://docs.openvidu.io/en/2.16.0/reference-docs/REST-API/#delete-openviduapisessionsltsession_idgtstreamltstream_idgt

publisher_count
signal(type_: str = None, data: str = None)[source]

Sends a signal to this connection.

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

Parameters:
  • type – Type of the signal. In the body example of the table above, only users subscribed to Session.on(‘signal:MY_TYPE’) will trigger that signal. Users subscribed to Session.on(‘signal’) will trigger signals of any type.
  • data – Actual data of the signal.
subscriber_count
class pyopenvidu.openviduconnection.OpenViduIPCAMConnection(session: requests_toolbelt.sessions.BaseUrlSession, data: dict)[source]

Bases: pyopenvidu.openviduconnection.OpenViduConnection

This object represents an OpenVidu IPCAM type of Connection. This is a connection between an IPCAM and a session.

Direct instantiation of this class is not supported! Use OpenViduSession.connections to get an instance of this class.

class pyopenvidu.openviduconnection.OpenViduWEBRTCConnection(session: requests_toolbelt.sessions.BaseUrlSession, data: dict)[source]

Bases: pyopenvidu.openviduconnection.OpenViduConnection

This object represents an OpenVidu WEBRTC type of Connection. This is a connection between an user and a session.

Direct instantiation of this class is not supported! Use OpenViduSession.connections to get an instance of this class.