Whether the session is being broadcasted or not
Array of Connections to the Session. This property always initialize as an empty array and will remain unchanged since the last time method Session.fetch or OpenVidu.fetch was called. Exceptions to this rule are:
To get the array of Connections with their current actual value, you must call Session.fetch or OpenVidu.fetch before consulting property connections
Timestamp when this session was created, in UTC milliseconds (ms since Jan 1, 1970, 00:00:00 UTC)
Properties defining the session
Whether the session is being recorded or not
Unique identifier of the Session
Gracefully closes the Session: unpublishes all streams and evicts every participant
A Promise that is resolved if the session has been closed successfully and rejected with an Error object if not
Creates a new Connection object associated to Session object and configured with
connectionProperties
. Each user connecting to the Session requires a Connection.
The token string value to send to the client side is available at Connection.token.
Optional
connectionProperties: ConnectionPropertiesA Promise that is resolved to the generated Connection object if success and rejected with an Error object if not
Updates every property of the Session with the current status it has in OpenVidu Server. This is especially useful for accessing the list of Connections of the Session (Session.connections, Session.activeConnections) and use those values to call Session.forceDisconnect, Session.forceUnpublish or Session.updateConnection.
To update all Session objects owned by OpenVidu object at once, call OpenVidu.fetch
A promise resolved to true if the Session status has changed with respect to the server, or to false if not. This applies to any property or sub-property of the Session object
Removes the Connection from the Session. This can translate into a forced eviction of a user from the Session if the
Connection had status active
or into a token invalidation if no user had taken the Connection yet (status pending
).
In the first case, OpenVidu Browser will trigger the proper events in the client-side (streamDestroyed
, connectionDestroyed
,
sessionDisconnected
) with reason set to "forceDisconnectByServer"
.
In the second case, the token of the Connection will be invalidated and no user will be able to connect to the session with it.
This method automatically updates the properties of the local affected objects. This means that there is no need to call Session.fetch or OpenVidu.fetch] to see the changes consequence of the execution of this method applied in the local objects.
The Connection object to remove from the session, or its connectionId
property
A Promise that is resolved if the Connection was successfully removed from the Session and rejected with an Error object if not
Forces some Connection to unpublish a Stream (identified by its streamId
or the corresponding Publisher object owning it).
OpenVidu Browser will trigger the proper events on the client-side (streamDestroyed
) with reason set to "forceUnpublishByServer"
.
You can get publisher
parameter from Connection.publishers array (Publisher.streamId for getting each streamId
property).
Remember to call Session.fetch or OpenVidu.fetch before to fetch the current actual properties of the Session from OpenVidu Server
This method automatically updates the properties of the local affected objects. This means that there is no need to call Session.fetch or OpenVidu.fetch to see the changes consequence of the execution of this method applied in the local objects.
The Publisher object to unpublish, or its streamId
property
A Promise that is resolved if the stream was successfully unpublished and rejected with an Error object if not
Optional
tokenOptions: TokenOptionsA Promise that is resolved to the generated token string if success and rejected with an Error object if not
Use Session.createConnection instead to get a Connection object.
This feature is part of OpenVidu PRO and ENTERPRISE editions
Updates the properties of a Connection with a ConnectionProperties object. Only these properties can be updated:
This method automatically updates the properties of the local affected objects. This means that there is no need to call Session.fetch or OpenVidu.fetch to see the changes consequence of the execution of this method applied in the local objects.
The affected client will trigger one ConnectionPropertyChangedEvent for each modified property.
The Connection.connectionId of the Connection object to modify
A new ConnectionProperties object with the updated values to apply
A Promise that is resolved to the updated Connection object if the operation was successful and rejected with an Error object if not
Array containing the active Connections of the Session. It is a subset of Session.connections array containing only those Connections with property Connection.status to
active
.To get the array of active Connections with their current actual value, you must call Session.fetch or OpenVidu.fetch before consulting property activeConnections