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 fetch or fetch was called. Exceptions to this rule are:
To get the array of Connections with their current actual value, you must call fetch or 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 token.
A Promise that is resolved to the generated Connection object if success and rejected with an Error object if not
Optional
connectionProperties: ConnectionPropertiesUpdates 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 (connections, activeConnections) and use those values to call forceDisconnect, forceUnpublish or updateConnection.
To update all Session objects owned by OpenVidu object at once, call 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 fetch or fetch] to see the changes consequence of the execution of this method applied in the local objects.
A Promise that is resolved if the Connection was successfully removed from the Session and rejected with an Error object if not
The Connection object to remove from the session, or its connectionId
property
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 publishers array (streamId for getting each streamId
property).
Remember to call fetch or 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 fetch or fetch to see the changes consequence of the execution of this method applied in the local objects.
A Promise that is resolved if the stream was successfully unpublished and rejected with an Error object if not
The Publisher object to unpublish, or its streamId
property
Use createConnection instead to get a Connection object.
A Promise that is resolved to the generated token string if success and rejected with an Error object if not
Optional
tokenOptions: TokenOptionsThis 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 fetch or 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.
A Promise that is resolved to the updated Connection object if the operation was successful and rejected with an Error object if not
The connectionId of the Connection object to modify
A new ConnectionProperties object with the updated values to apply
Generated using TypeDoc
Array containing the active Connections of the Session. It is a subset of connections array containing only those Connections with property status to
active
.To get the array of active Connections with their current actual value, you must call fetch or fetch before consulting property activeConnections