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 |
build()
Builds
ConnectOptions object. |
ConnectOptions.Builder |
dataTracks(List<LocalDataTrack> dataTracks)
Data tracks that will be published upon connection.
|
ConnectOptions.Builder |
enableInsights(boolean enable)
Enable sending stats data to Insights.
|
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 |
preferAudioCodecs(List<AudioCodec> preferredAudioCodecs)
Set preferred audio codecs.
|
ConnectOptions.Builder |
preferVideoCodecs(List<VideoCodec> preferredVideoCodecs)
Set preferred video codecs.
|
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 enableInsights(boolean enable)
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 encodingParameters(EncodingParameters encodingParameters)
EncodingParameters
for audio and video tracks shared to a Room
.public ConnectOptions build()
ConnectOptions
object.Exception
- if accessToken is null or empty.3.2.2