Class ConnectRequest.Builder

java.lang.Object
com.vonage.client.video.ConnectRequest.Builder
Enclosing class:
ConnectRequest

public static final class ConnectRequest.Builder extends Object
Builder for defining the fields in a ConnectRequest object.
  • Method Details

    • token

      (REQUIRED) A valid Vonage Video token for the Audio Connector connection to the Vonage Video Session. You can add additional data to the JWT to identify that the connection is the Audio Connector endpoint or for any other identifying data.
      Parameters:
      token - The Base64-encoded JWT as a string.
      Returns:
      This builder.
    • sessionId

      The Vonage Video session ID that includes the Vonage Video streams you want to include in the WebSocket stream. The Audio Connector feature is only supported in routed sessions.
      Parameters:
      sessionId - The session ID as a string.
      Returns:
      This builder.
    • uri

      (REQUIRED) A publicly reachable WebSocket URI to be used for the destination of the audio stream. This must start with the ws:// or wss:// protocol.
      Parameters:
      uri - The WebSocket URI as a string.
      Returns:
      This builder.
    • streams

      public ConnectRequest.Builder streams(String... streams)
      (OPTIONAL) An array of stream IDs for the Vonage Video streams you want to include in the WebSocket audio. If you omit this property, all streams in the session will be included.
      Parameters:
      streams - The stream IDs to include in the audio.
      Returns:
      This builder.
    • streams

      A collection of stream IDs for the Vonage Video streams you want to include in the WebSocket audio. If you omit this property, all streams in the session will be included.
      Parameters:
      streams - The stream IDs to include in the audio connection.
      Returns:
      This builder.
    • headers

      Key-value pairs of headers to be sent to your WebSocket server with each message, with a maximum length of 512 bytes.
      Parameters:
      headers - The custom request headers as a Map.
      Returns:
      This builder.
    • audioRate

      A number representing the audio sampling rate in Hz.
      Parameters:
      audioRate - The sampling rate as an enum.
      Returns:
      This builder.
    • build

      Builds the ConnectRequest object.
      Returns:
      The ConnectRequest object with this builder's settings.