Package com.opentok.android
Class Session.Builder
java.lang.Object
com.opentok.android.Session.Builder
- Enclosing class:
Session
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Defines a custom TURN server used in thesetCustomIceServers(List, IncludeServers)
method.static enum
Defines settings for whether to use only your custom TURN servers or to use those servers in addition to Vonage Video API TURN servers.static enum
Defines settings for whether to use all ICE transport types (such as host, srflx, and TURN) to establish media connectivity or to only use TURN. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a newSession
instance based on theSession.Builder
settings.connectionEventsSuppressed
(Boolean enabled) Prevent connection events (such asSession.ConnectionListener.onConnectionCreated(Session session, Connection connection)
) from being dispatched.sessionOptions
(Session.SessionOptions sessionOptions) Sets advanced options for the session.Deprecated.setCustomIceServers
(List<Session.Builder.IceServer> serverList, Session.Builder.IncludeServers config) Sets the list of custom TURN servers to be used by the client in this session.Set the TURN server transport policy to be used by the client in this session.setIpWhitelist
(boolean enabled) Set this totrue
if the allowed IP list feature is enabled for your project.setProxyUrl
(String proxyUrl) Set this to the URL of the IP proxy server.setSessionMigration
(boolean enable) Enables the session migration feature, allowing the client to to remain connected during server rotation.setSinglePeerConnection
(boolean enable) Single Peer Connection (SPC) is a feature that encapsulates all subscriber connections to a single peer connection.
-
Constructor Details
-
Builder
Use this builder to create a Session instance.- Parameters:
context
- The Android application context associated with this process.apiKey
- Your OpenTok API key. See your Vonage Video API account page. Important: If you are using the Video API with a Vonage application (instead of an OpenTok project), pass in the application ID (not an OpenTok API key) for this parameter.sessionId
- The OpenTok session ID this instance should connect to. For test purposes, you can generate test session by logging into your Vonage Video API account. Use the OpenTok server-side SDKs to generate session IDs in your shipping app.- See Also:
-
-
Method Details
-
connectionEventsSuppressed
Prevent connection events (such asSession.ConnectionListener.onConnectionCreated(Session session, Connection connection)
) from being dispatched.The default value is
false
. -
sessionOptions
Sets advanced options for the session.- See Also:
-
setCustomIceServers
public Session.Builder setCustomIceServers(List<Session.Builder.IceServer> serverList, Session.Builder.IncludeServers config) Sets the list of custom TURN servers to be used by the client in this session. See the configurable TURN servers developer guide. -
setIceRouting
Set the TURN server transport policy to be used by the client in this session. See the configurable TURN servers developer guide. -
setApiUrl
Deprecated.This method is deprecated. (Calling it has no effect.) -
setIpWhitelist
Set this totrue
if the allowed IP list feature is enabled for your project. (This is available as an add-on feature.) The default value isfalse
. -
setProxyUrl
Set this to the URL of the IP proxy server. This is available as an add-on feature. See the OpenTok pricing page and the IP proxy developer guide. -
setSinglePeerConnection
Single Peer Connection (SPC) is a feature that encapsulates all subscriber connections to a single peer connection. The benefits of enabling SPC include reduced OS resource consumption, improved rate control, and, in case of mobile native devices, support for larger sessions.SPC is disabled by default. When disabled, the session will use Multiple Peer Connection (MPC), where a separate peer connection is established between each endpoint.
-
setSessionMigration
Enables the session migration feature, allowing the client to to remain connected during server rotation. The default value isfalse
(session migration is not enabled). For more information, see Server Rotation and Session Migration.This is a beta feature.
-
build
Returns a newSession
instance based on theSession.Builder
settings.
-