Package io.openvidu.java.client
Class Connection
- java.lang.Object
-
- io.openvidu.java.client.Connection
-
public class Connection extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Long
activeAt()
Timestamp when this Connection was taken by a user (passing from status "pending" to "active"), in UTC milliseconds (ms since Jan 1, 1970, 00:00:00 UTC)Boolean
adaptativeBitrate()
Whether the Connection uses adaptative bitrate (and therefore adaptative quality) or not.Long
createdAt()
Timestamp when this Connection was created, in UTC milliseconds (ms since Jan 1, 1970, 00:00:00 UTC)String
getClientData()
Returns the data associated to the connection on the client-side.String
getConnectionId()
Returns the identifier of the Connection.List<IceServerProperties>
getCustomIceServers()
Returns a list of custom ICE Servers configured for this connection.String
getIp()
Returns the IP of the connection, as seen by OpenVidu ServerString
getLocation()
PRO Returns the geo location of the connection, with the following format:"CITY, COUNTRY"
("unknown"
if it wasn't possible to locate it)Integer
getNetworkCache()
Returns the size of the buffer of the endpoint receiving the IP camera's stream, in milliseconds.String
getPlatform()
Returns a complete description of the platform used by the participant to connect to the sessionList<Publisher>
getPublishers()
Returns the list of Publisher objects this particular Connection is publishing to the Session (each Publisher object has one Stream, uniquely identified by itsstreamId
).OpenViduRole
getRole()
Returns the role of the Connection.String
getRtspUri()
Returns the RTSP URI of the Connection.String
getServerData()
Returns the data associated to the Connection on the server-side.String
getStatus()
Returns the status of the Connection.List<String>
getSubscribers()
Returns the list of streams (theirstreamId
properties) this particular Connection is subscribed to.String
getToken()
Returns the token string associated to the Connection.ConnectionType
getType()
Returns the type of Connection.Boolean
onlyPlayWithSubscribers()
Whether the IP camera stream of this Connection will only be enabled when some user is subscribed to it, or not.boolean
record()
Whether the streams published by this Connection will be recorded or not.
-
-
-
Method Detail
-
getConnectionId
public String getConnectionId()
Returns the identifier of the Connection. You can call methodsSession.forceDisconnect(String)
orSession.updateConnection(String, ConnectionProperties)
passing this property as parameter
-
getStatus
public String getStatus()
Returns the status of the Connection. Can be:pending
: if the Connection is waiting for any user to use its internal token to connect to the session, calling method Session.connect in OpenVidu Browser.active
: if the internal token of the Connection has already been used by some user to connect to the session, and it cannot be used again.
-
createdAt
public Long createdAt()
Timestamp when this Connection was created, in UTC milliseconds (ms since Jan 1, 1970, 00:00:00 UTC)
-
activeAt
public Long activeAt()
Timestamp when this Connection was taken by a user (passing from status "pending" to "active"), in UTC milliseconds (ms since Jan 1, 1970, 00:00:00 UTC)
-
getType
public ConnectionType getType()
Returns the type of Connection.
-
getServerData
public String getServerData()
Returns the data associated to the Connection on the server-side. This value is set withTokenOptions.Builder.data(String)
when callingSession.generateToken()
-
record
public boolean record()
Whether the streams published by this Connection will be recorded or not. This only affects INDIVIDUAL recording .
-
getRole
public OpenViduRole getRole()
-
getRtspUri
public String getRtspUri()
-
adaptativeBitrate
public Boolean adaptativeBitrate()
Whether the Connection uses adaptative bitrate (and therefore adaptative quality) or not. For local network connections that do not require media transcoding this can be disabled to save CPU power. If you are not sure if transcoding might be necessary, setting this property to false may result in media connections not being established.
Only forConnectionType.IPCAM
-
onlyPlayWithSubscribers
public Boolean onlyPlayWithSubscribers()
Whether the IP camera stream of this Connection will only be enabled when some user is subscribed to it, or not. This allows you to reduce power consumption and network bandwidth in your server while nobody is asking to receive the camera's video. On the counterpart, first user subscribing to the IP camera stream will take a little longer to receive its video.
Only forConnectionType.IPCAM
-
getNetworkCache
public Integer getNetworkCache()
Returns the size of the buffer of the endpoint receiving the IP camera's stream, in milliseconds. The smaller it is, the less delay the signal will have, but more problematic will be in unstable networks. Use short buffers only if there is a quality connection between the IP camera and OpenVidu Server.
Only forConnectionType.IPCAM
-
getCustomIceServers
public List<IceServerProperties> getCustomIceServers()
Returns a list of custom ICE Servers configured for this connection.
SeeConnectionProperties.Builder.addCustomIceServer(IceServerProperties)
for more information.
Only forConnectionType.WEBRTC
-
getToken
public String getToken()
Returns the token string associated to the Connection. This is the value that must be sent to the client-side to be consumed in OpenVidu Browser method Session.connect .
-
getLocation
public String getLocation()
PRO Returns the geo location of the connection, with the following format:"CITY, COUNTRY"
("unknown"
if it wasn't possible to locate it)
-
getIp
public String getIp()
Returns the IP of the connection, as seen by OpenVidu Server
-
getPlatform
public String getPlatform()
Returns a complete description of the platform used by the participant to connect to the session
-
getClientData
public String getClientData()
Returns the data associated to the connection on the client-side. This value is set with second parameter of method Session.connect in OpenVidu Browser
-
getPublishers
public List<Publisher> getPublishers()
Returns the list of Publisher objects this particular Connection is publishing to the Session (each Publisher object has one Stream, uniquely identified by itsstreamId
). You can callSession.forceUnpublish(Publisher)
passing any of this values as parameter
-
getSubscribers
public List<String> getSubscribers()
Returns the list of streams (theirstreamId
properties) this particular Connection is subscribed to. Each one always corresponds to one Publisher of some other Connection: each string of the returned list must be equal to the returned value of somePublisher.getStreamId()
-
-