Package com.opentok
Class SessionProperties.Builder
java.lang.Object
com.opentok.SessionProperties.Builder
- Enclosing class:
- SessionProperties
Use this class to create a SessionProperties object.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarchiveMode
(ArchiveMode archiveMode) Call this method to determine whether the session will be automatically archived (ArchiveMode.ALWAYS
) or not (ArchiveMode.MANUAL
).archiveName
(String archiveName) Indicates the archive name for all the archives in auto archived session.archiveResolution
(Resolution archiveResolution) Indicates the archive resolution for all the archives in auto archived session.build()
Builds the SessionProperties object.Enables end-to-end encryption for a routed session.Call this method to set an IP address that the OpenTok servers will use to situate the session in its global network.Call this method to determine whether the session will transmit streams using the OpenTok Media Router (MediaMode.ROUTED
) or not (MediaMode.RELAYED
).
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
location
Call this method to set an IP address that the OpenTok servers will use to situate the session in its global network. If you do not set a location hint, the OpenTok servers will be based on the first client connecting to the session.- Parameters:
location
- The IP address to serve as the location hint.- Returns:
- The SessionProperties.Builder object with the location hint setting.
- Throws:
InvalidArgumentException
-
mediaMode
Call this method to determine whether the session will transmit streams using the OpenTok Media Router (MediaMode.ROUTED
) or not (MediaMode.RELAYED
). By default, themediaMode
property is set toMediaMode.RELAYED
.With the
mediaMode
property set toMediaMode.RELAYED
, the session will attempt to transmit streams directly between clients. If clients cannot connect due to firewall restrictions, the session uses the OpenTok TURN server to relay audio-video streams.The OpenTok Media Router provides the following benefits:
- The OpenTok Media Router can decrease bandwidth usage in multiparty sessions.
(When the
mediaMode
property is set toMediaMode.RELAYED
, each client must send a separate audio-video stream to each client subscribing to it.) - The OpenTok Media Router can improve the quality of the user experience through audio fallback and video recovery. With these features, if a client's connectivity degrades to a degree that it does not support video for a stream it's subscribing to, the video is dropped on that client (without affecting other clients), and the client receives audio only. If the client's connectivity improves, the video returns.
- The OpenTok Media Router supports the archiving feature, which lets you record, save, and retrieve OpenTok sessions.
- Parameters:
mediaMode
- Set to a value defined in theMediaMode
enum.- Returns:
- The SessionProperties.Builder object with the media mode setting.
- The OpenTok Media Router can decrease bandwidth usage in multiparty sessions.
(When the
-
archiveMode
Call this method to determine whether the session will be automatically archived (ArchiveMode.ALWAYS
) or not (ArchiveMode.MANUAL
).Using an always archived session also requires the routed media mode (
MediaMode.ROUTED
).- Parameters:
archiveMode
- The Archive mode.- Returns:
- The SessionProperties.Builder object with the archive mode setting.
-
archiveResolution
Indicates the archive resolution for all the archives in auto archived session. A session that begins with archive modeArchiveMode.ALWAYS
will use this resolution for all archives of that session.- Parameters:
archiveResolution
- The auto archive resolution as an enum.- Returns:
- The SessionProperties.Builder object with the archive resolution setting.
-
archiveName
Indicates the archive name for all the archives in auto archived session. A session that begins with archive modeArchiveMode.ALWAYS
will use this archive name for all archives of that session.- Parameters:
archiveName
- The archive name, maximum 80 characters in length.- Returns:
- The SessionProperties.Builder object with the archive name setting.
-
endToEndEncryption
Enables end-to-end encryption for a routed session. You must also setmediaMode(MediaMode)
to MediaMode.ROUTED when calling this method.- Returns:
- The SessionProperties.Builder object with the e2ee property set to
true
.
-
build
Builds the SessionProperties object.- Returns:
- The SessionProperties object.
-