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)
AudioCodec.OPUS
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(AudioCodec.ISAC))
.build();
The following snippet demonstrates how to specify the exact order of codec preferences.
ConnectOptions connectOptions = new ConnectOptions.Builder(token)
.preferAudioCodecs(Arrays.asList(AudioCodec.ISAC,
AudioCodec.G722, AudioCodec.OPUS))
.build();
public ConnectOptions.Builder preferVideoCodecs(List<VideoCodec> preferredVideoCodecs)
VideoCodec.VP8
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(VideoCodec.H264))
.build();
The following snippet demonstrates how to specify the exact order of codec preferences.
ConnectOptions connectOptions = new ConnectOptions.Builder(token)
.preferVideoCodecs(Arrays.asList(VideoCodec.H264,
VideoCodec.VP8, VideoCodec.VP9))
.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.