Package com.twilio.voice
Class PreflightOptions.Builder
java.lang.Object
com.twilio.voice.PreflightOptions.Builder
- Enclosing class:
- PreflightOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
BuildsPreflightOptions
object.iceOptions
(IceOptions iceOptions) Custom ICE configuration used to connect to a Call.preferAudioCodecs
(List<AudioCodec> preferredAudioCodecs) Set preferred audio codecs.
-
Constructor Details
-
Builder
Use this Builder when making aPreflightTest
The maximum number of characters for the identity provided in the token is 121. The identity may only contain alpha-numeric and underscore characters. Other characters, including spaces, or exceeding the maximum number of characters, will result in not being able to place or receive calls.
- Parameters:
accessToken
- The accessToken that provides the identity and grants of the caller in a JSON Web Token(JWT) format.
-
-
Method Details
-
iceOptions
Custom ICE configuration used to connect to a Call. -
preferAudioCodecs
@NonNull public PreflightOptions.Builder preferAudioCodecs(@NonNull List<AudioCodec> preferredAudioCodecs) Set preferred audio codecs. The list specifies which audio codecs would be preferred when negotiating audio with the backend service. The preferences are applied in the order found in the list starting with the most preferred audio codec to the least preferred audio codec. Audio codec preferences are not guaranteed to be satisfied because the backend service is not guaranteed to support all audio codecs.The following snippet demonstrates how to prefer a single audio codec.
PreflightOptions options = new PreflightOptions.Builder(token) .preferAudioCodecs(Collections.<AudioCodec>singletonList(new PcmuCodec())) .build();
The following snippet demonstrates how to specify the exact order of codec preferences.
PreflightOptions options = new PreflightOptions.Builder(token) .preferAudioCodecs(Arrays.asList(new PcmuCodec(), new OpusCodec())) .build();
-
build
BuildsPreflightOptions
object.
-