public static class ConnectOptions.Builder extends Object
ConnectOptions
.
All methods are optional.
Modifier and Type | Method and Description |
---|---|
ConnectOptions.Builder |
audioTracks(List<LocalAudioTrack> audioTracks)
Audio tracks that will be published upon connection.
|
ConnectOptions.Builder |
bandwidthProfile(BandwidthProfileOptions bandwidthProfile)
Configure how the available downlink bandwidth is shared among the
RemoteVideoTrack s you have subscribed to in a Group or Small-Group Room. |
ConnectOptions |
build()
Builds
ConnectOptions object. |
ConnectOptions.Builder |
dataTracks(List<LocalDataTrack> dataTracks)
Data tracks that will be published upon connection.
|
ConnectOptions.Builder |
enableAutomaticSubscription(boolean enableAutomaticSubscription)
Toggles automatic track subscription.
|
ConnectOptions.Builder |
enableDominantSpeaker(boolean enableDominantSpeaker)
Enable reporting of a
Room 's dominant speaker. |
ConnectOptions.Builder |
enableIceGatheringOnAnyAddressPorts(boolean enable)
Enable gathering of ICE candidates on "any address" ports.
|
ConnectOptions.Builder |
enableInsights(boolean enable)
Enable sending stats data to Insights.
|
ConnectOptions.Builder |
enableNetworkQuality(boolean enableNetworkQuality)
Enable or disable the Network Quality API.
|
ConnectOptions.Builder |
encodingParameters(EncodingParameters encodingParameters)
Set
EncodingParameters for audio and video tracks shared to a Room . |
ConnectOptions.Builder |
iceOptions(IceOptions iceOptions)
Custom ICE configuration used to connect to a Room.
|
ConnectOptions.Builder |
networkQualityConfiguration(NetworkQualityConfiguration networkQualityConfiguration)
Sets the verbosity level for network quality information returned by the Network Quality
API.
|
ConnectOptions.Builder |
preferAudioCodecs(List<AudioCodec> preferredAudioCodecs)
Set preferred audio codecs.
|
ConnectOptions.Builder |
preferVideoCodecs(List<VideoCodec> preferredVideoCodecs)
Set preferred video codecs.
|
ConnectOptions.Builder |
region(String region)
The region of the signaling Server the Client will use.
|
ConnectOptions.Builder |
roomName(String roomName)
The name of the room.
|
ConnectOptions.Builder |
videoTracks(List<LocalVideoTrack> videoTracks)
Video tracks that will be published upon connection.
|
public Builder(String accessToken)
public ConnectOptions.Builder roomName(String roomName)
public ConnectOptions.Builder audioTracks(List<LocalAudioTrack> audioTracks)
public ConnectOptions.Builder videoTracks(List<LocalVideoTrack> videoTracks)
public ConnectOptions.Builder dataTracks(List<LocalDataTrack> dataTracks)
public ConnectOptions.Builder iceOptions(IceOptions iceOptions)
public ConnectOptions.Builder enableIceGatheringOnAnyAddressPorts(boolean enable)
public ConnectOptions.Builder enableInsights(boolean enable)
public ConnectOptions.Builder enableAutomaticSubscription(boolean enableAutomaticSubscription)
public ConnectOptions.Builder enableDominantSpeaker(boolean enableDominantSpeaker)
public ConnectOptions.Builder enableNetworkQuality(boolean enableNetworkQuality)
Set this to true
to enable the Network Quality API when using Group Rooms.
This option has no effect in Peer-to-Peer Rooms. The default value is false
.
public ConnectOptions.Builder networkQualityConfiguration(NetworkQualityConfiguration networkQualityConfiguration)
If a NetworkQualityConfiguration
is not provided, the default configuration is
used: NetworkQualityVerbosity.NETWORK_QUALITY_VERBOSITY_MINIMAL
for the Local
Participant and NetworkQualityVerbosity.NETWORK_QUALITY_VERBOSITY_NONE
for the
Remote Participants.
public ConnectOptions.Builder preferAudioCodecs(List<AudioCodec> preferredAudioCodecs)
OpusCodec
is the default audio codec
if no preferences are set.
The following snippet demonstrates how to prefer a single audio codec.
ConnectOptions connectOptions = new ConnectOptions.Builder(token)
.preferAudioCodecs(Collections.singletonList(new IsacCodec()))
.build();
The following snippet demonstrates how to specify the exact order of codec preferences.
ConnectOptions connectOptions = new ConnectOptions.Builder(token)
.preferAudioCodecs(Arrays.asList(new IsacCodec(),
new G722Codec(), new OpusCodec()))
.build();
public ConnectOptions.Builder preferVideoCodecs(List<VideoCodec> preferredVideoCodecs)
Vp8Codec
is the default video codec
if no preferences are set.
The following snippet demonstrates how to prefer a single video codec.
ConnectOptions connectOptions = new ConnectOptions.Builder(token)
.preferVideoCodecs(Collections.singletonList(new H264Codec()))
.build();
The following snippet demonstrates how to specify the exact order of codec preferences.
ConnectOptions connectOptions = new ConnectOptions.Builder(token)
.preferVideoCodecs(Arrays.asList(new H264Codec(),
new Vp8Codec(), new Vp9Codec()))
.build();
public ConnectOptions.Builder region(String region)
public ConnectOptions.Builder encodingParameters(EncodingParameters encodingParameters)
EncodingParameters
for audio and video tracks shared to a Room
.public ConnectOptions.Builder bandwidthProfile(BandwidthProfileOptions bandwidthProfile)
RemoteVideoTrack
s you have subscribed to in a Group or Small-Group Room. This property
has no effect in Peer-to-Peer Rooms.bandwidthProfile
- The profile to use.public ConnectOptions build()
ConnectOptions
object.Exception
- if accessToken is null or empty.5.13.0