Class Connection

    • Method Detail

      • 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.
      • record

        public boolean record()
        Whether the streams published by this Connection will be recorded or not. This only affects INDIVIDUAL recording.
      • 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 for ConnectionType.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 for ConnectionType.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 for ConnectionType.IPCAM
      • 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 its streamId). You can call Session.forceUnpublish(Publisher) passing any of this values as parameter
      • getSubscribers

        public List<String> getSubscribers()
        Returns the list of streams (their streamId 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 some Publisher.getStreamId()