Package com.opentok
Class SessionProperties.Builder
- java.lang.Object
-
- com.opentok.SessionProperties.Builder
-
- Enclosing class:
- SessionProperties
public static class SessionProperties.Builder extends java.lang.Object
Use this class to create a SessionProperties object.- See Also:
SessionProperties
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionProperties.Builder
archiveMode(ArchiveMode archiveMode)
Call this method to determine whether the session will be automatically archived (ArchiveMode.ALWAYS
) or not (ArchiveMode.MANUAL
).SessionProperties.Builder
archiveName(java.lang.String archiveName)
Indicates the archive name for all the archives in auto archived session.SessionProperties.Builder
archiveResolution(Resolution archiveResolution)
Indicates the archive resolution for all the archives in auto archived session.SessionProperties
build()
Builds the SessionProperties object.SessionProperties.Builder
endToEndEncryption()
Enables end-to-end encryption for a routed session.SessionProperties.Builder
location(java.lang.String location)
Call this method to set an IP address that the OpenTok servers will use to situate the session in its global network.SessionProperties.Builder
mediaMode(MediaMode mediaMode)
Call this method to determine whether the session will transmit streams using the OpenTok Media Router (MediaMode.ROUTED
) or not (MediaMode.RELAYED
).
-
-
-
Method Detail
-
location
public SessionProperties.Builder location(java.lang.String location) throws InvalidArgumentException
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
public SessionProperties.Builder mediaMode(MediaMode 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
public SessionProperties.Builder archiveMode(ArchiveMode 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
public SessionProperties.Builder archiveResolution(Resolution 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
public SessionProperties.Builder archiveName(java.lang.String 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
public SessionProperties.Builder 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
public SessionProperties build()
Builds the SessionProperties object.- Returns:
- The SessionProperties object.
-
-