java.lang.Object

com.opentok.SessionProperties.Builder

Enclosing class: : SessionProperties


public static class SessionProperties.Builder extends Object

Use this class to create a SessionProperties object.

See Also: : - SessionProperties

Constructor Summary

Constructors

Constructor

Description

Builder()

Method Summary

All MethodsInstance MethodsConcrete 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(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(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).

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

Builder

public Builder()

Method Details

location

public SessionProperties.Builder location(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, the mediaMode property is set to MediaMode.RELAYED.

With the mediaMode property set to MediaMode.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 to MediaMode.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 the MediaMode enum.

Returns: : The SessionProperties.Builder object with the media mode setting.

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 mode ArchiveMode.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(String archiveName)

Indicates the archive name for all the archives in auto archived session. A session that begins with archive mode ArchiveMode.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 set mediaMode(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.