Package io.openvidu.java.client
Class ConnectionProperties.Builder
- java.lang.Object
-
- io.openvidu.java.client.ConnectionProperties.Builder
-
- Enclosing class:
- ConnectionProperties
public static class ConnectionProperties.Builder extends Object
Builder forConnectionProperties
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionProperties.Builder
adaptativeBitrate(boolean adaptativeBitrate)
Call this method to set whether to use adaptative bitrate (and therefore adaptative quality) or not.ConnectionProperties.Builder
addCustomIceServer(IceServerProperties iceServerProperties)
On certain type of networks, clients using default OpenVidu STUN/TURN server can not be reached it because firewall rules and network topologies at the client side.ConnectionProperties
build()
Builder forConnectionProperties
.ConnectionProperties.Builder
data(String data)
Call this method to set the secure (server-side) data associated to this Connection.ConnectionProperties.Builder
kurentoOptions(KurentoOptions kurentoOptions)
Call this method to set aKurentoOptions
object for this Connection.ConnectionProperties.Builder
networkCache(int networkCache)
Call this method to set the size of the buffer of the endpoint receiving the IP camera's stream, in milliseconds.ConnectionProperties.Builder
onlyPlayWithSubscribers(boolean onlyPlayWithSubscribers)
Call this method to set whether to enable the IP camera stream only when some user is subscribed to it, or not.ConnectionProperties.Builder
record(boolean record)
Call this method to flag the streams published by this Connection to be recorded or not.ConnectionProperties.Builder
role(OpenViduRole role)
Call this method to set the role assigned to this Connection.ConnectionProperties.Builder
rtspUri(String rtspUri)
Call this method to set the RTSP URI of an IP camera.ConnectionProperties.Builder
type(ConnectionType type)
Call this method to set the type of Connection.
-
-
-
Method Detail
-
build
public ConnectionProperties build()
Builder forConnectionProperties
.
-
type
public ConnectionProperties.Builder type(ConnectionType type)
Call this method to set the type of Connection. TheConnectionType
dictates what properties will have effect:ConnectionType.WEBRTC
:data
,record
,role
,kurentoOptions
ConnectionType.IPCAM
:data
,record
,rtspUri
,adaptativeBitrate
,onlyPlayWithSubscribers
,networkCache
ConnectionType.WEBRTC
.
-
data
public ConnectionProperties.Builder data(String data)
Call this method to set the secure (server-side) data associated to this Connection. Every client will receive this data in propertyConnection.data
. ObjectConnection
can be retrieved by subscribing to eventconnectionCreated
of Session object in your clients.- If you have provided no data in your clients when calling method
Session.connect(TOKEN, DATA)
(DATA
not defined), thenConnection.data
will only have thisdata(String)
property. - If you have provided some data when calling
Session.connect(TOKEN, DATA)
(DATA
defined), thenConnection.data
will have the following structure:"CLIENT_DATA%/%SERVER_DATA"
, beingCLIENT_DATA
the second parameter passed in OpenVidu Browser in methodSession.connect
andSERVER_DATA
thisdata(String)
property.
- If you have provided no data in your clients when calling method
-
record
public ConnectionProperties.Builder record(boolean record)
Call this method to flag the streams published by this Connection to be recorded or not. This only affects INDIVIDUAL recording . If not set, by default will be true.
-
role
public ConnectionProperties.Builder role(OpenViduRole role)
Call this method to set the role assigned to this Connection. If not set by default will bePUBLISHER
.
Only forConnectionType.WEBRTC
-
kurentoOptions
public ConnectionProperties.Builder kurentoOptions(KurentoOptions kurentoOptions)
-
rtspUri
public ConnectionProperties.Builder rtspUri(String rtspUri) throws MalformedURLException
Call this method to set the RTSP URI of an IP camera. For example:rtsp://your.camera.ip:7777/path
Only forConnectionType.IPCAM
- Throws:
MalformedURLException
-
adaptativeBitrate
public ConnectionProperties.Builder adaptativeBitrate(boolean adaptativeBitrate)
Call this method to set whether to use 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. Default totrue
.
Only forConnectionType.IPCAM
-
onlyPlayWithSubscribers
public ConnectionProperties.Builder onlyPlayWithSubscribers(boolean onlyPlayWithSubscribers)
Call this method to set whether to enable the IP camera stream only 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. Default totrue
.
Only forConnectionType.IPCAM
-
networkCache
public ConnectionProperties.Builder networkCache(int networkCache)
Call this method to set 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. Default to2000
.
Only forConnectionType.IPCAM
-
addCustomIceServer
public ConnectionProperties.Builder addCustomIceServer(IceServerProperties iceServerProperties)
On certain type of networks, clients using default OpenVidu STUN/TURN server can not be reached it because firewall rules and network topologies at the client side. This method allows you to configure your own ICE Server for specific connections if you need it. This is usually not necessary, only it is usefull for OpenVidu users behind firewalls which allows traffic from/to specific ports which may need a custom ICE Server configuration Add an ICE Server if in your use case you need this connection to use your own ICE Server deployment. When the user uses this connection, it will use the specified ICE Servers defined here. The level of precedence for ICE Server configuration on every OpenVidu connection is:- Configured ICE Server using Openvidu.setAdvancedCofiguration() at openvidu-browser.
- Configured ICE server at
ConnectionProperties.customIceServers
- Configured ICE Server at global configuration parameter: OPENVIDU_WEBRTC_ICE_SERVERS
- Default deployed Coturn within OpenVidu deployment
If no value is found at level 1, level 2 will be used, and so on until level 4.
This method is equivalent to level 2 of precedence.
Only forConnectionType.WEBRTC
-
-