Package com.opentok

Class AudioConnectorProperties.Builder

java.lang.Object
com.opentok.AudioConnectorProperties.Builder
Enclosing class:
AudioConnectorProperties

public static class AudioConnectorProperties.Builder extends Object
Intermediary stateful object used to construct AudioConnectorProperties.
  • Constructor Details

    • Builder

      public Builder(URI uri)
      Constructor for the AudioConnectorProperties.Builder, using a URI to define the WebSocket URI.
      Parameters:
      uri - The publicly reachable WebSocket URI to be used for the destination of the audio stream.
    • Builder

      public Builder(String uri)
      Constructor for the AudioConnectorProperties.Builder, using a string to define the WebSocket URI.
      Parameters:
      uri - The publicly reachable WebSocket URI to be used for the destination of the audio stream, as a string (such as "wss://example.com/ws-endpoint").
  • Method Details

    • addStream

      public AudioConnectorProperties.Builder addStream(String stream)
      Adds an OpenTok stream (with the corresponding stream ID) to include in the WebSocket audio. If the AudioConnectorProperties includes no streams, all streams in the session will be included.
      Parameters:
      stream - The stream ID.
      Returns:
      This builder with the additional stream ID.
    • addStreams

      public AudioConnectorProperties.Builder addStreams(String... streams)
      Adds OpenTok streams (with the corresponding stream IDs) to include in the WebSocket audio. If the AudioConnectorProperties includes no streams, all streams in the session will be included.
      Parameters:
      streams - The stream IDs to add.
      Returns:
      This builder with the additional stream IDs.
    • addStreams

      public AudioConnectorProperties.Builder addStreams(Collection<String> streams)
      Adds OpenTok streams (with the corresponding stream IDs) to include in the WebSocket audio. If the AudioConnectorProperties includes no streams, all streams in the session will be included.
      Parameters:
      streams - The collection of stream IDs to add.
      Returns:
      This builder with the additional stream IDs.
    • addHeaders

      public AudioConnectorProperties.Builder addHeaders(Map<String,String> headers)
      Puts all entries of the map into the headers parameter. The headers will be sent to your WebSocket server with each message.
      Parameters:
      headers - The map of header key-value pairs to append.
      Returns:
      This builder with the specified headers included.
    • addHeader

      public AudioConnectorProperties.Builder addHeader(String key, String value)
      Adds a header entry to this object's headers property. The header will be sent to your WebSocket server with each message.
      Parameters:
      key - Header key.
      value - Header value.
      Returns:
      This builder with the additional header property.
    • build

      public AudioConnectorProperties build()
      Builds the AudioConnectorProperties object.
      Returns:
      The constructed AudioConnectorProperties object.