Package com.opentok

Class BroadcastProperties.Builder

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

public static class BroadcastProperties.Builder extends Object
Used to create a BroadcastProperties object.
See Also:
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • layout

      Customizes the layout of the broadcast.
      Parameters:
      layout - An object of type BroadcastLayout.
      Returns:
      The BroadcastProperties.Builder object with the layout setting.
    • maxDuration

      public BroadcastProperties.Builder maxDuration(int maxDuration) throws InvalidArgumentException
      Sets the maximum duration, in seconds, of the broadcast. The broadcast will automatically stop when the maximum duration is reached. You can set the maximum duration to a value from 60 (60 seconds) to 36000 (10 hours). The default maximum duration is 2 hours (7200 seconds).
      Parameters:
      maxDuration - The maximum duration in seconds.
      Returns:
      The BroadcastProperties.Builder object with the maxDuration setting.
      Throws:
      InvalidArgumentException
    • maxBitrate

      public BroadcastProperties.Builder maxBitrate(int maxBitrate) throws InvalidArgumentException
      Sets the maximum bitrate in bits per second for broadcast composing.
      Parameters:
      maxBitrate - The maximum bitrate in bits per second.
      Returns:
      The BroadcastProperties.Builder object with the maxBitrate setting.
      Throws:
      InvalidArgumentException - If the bitrate is out of bounds.
    • hasHls

      public BroadcastProperties.Builder hasHls(boolean hasHls)
      Call this method to include an HLS broadcast (true) or not false).
      Parameters:
      hasHls - Whether the HLS broadcast is enabled or not.
      Returns:
      The BroadcastProperties.Builder object with the HLS setting.
    • hls

      public BroadcastProperties.Builder hls(Hls hls)
      Call this method to include HLS options. This will set hasHls to true.
      Parameters:
      hls - The HLS object.
      Returns:
      The BroadcastProperties.Builder object with HLS populated.
    • hasAudio

      public BroadcastProperties.Builder hasAudio(boolean hasAudio)
      Whether to include audio in the broadcast (true by default).
      Parameters:
      hasAudio - true if audio should be included, false otherwise.
      Returns:
      The BroadcastProperties.Builder object with the hasAudio setting.
    • hasVideo

      public BroadcastProperties.Builder hasVideo(boolean hasVideo)
      Whether to include video in the broadcast (true by default).
      Parameters:
      hasVideo - true if video should be included, false otherwise.
      Returns:
      The BroadcastProperties.Builder object with the hasVideo setting.
    • addRtmpProperties

      public BroadcastProperties.Builder addRtmpProperties(RtmpProperties rtmpProps) throws InvalidArgumentException
      Call this method to set a list of RTMP broadcast streams. There is a limit of 5 RTMP streams.
      Parameters:
      rtmpProps - The RtmpProperties object defining the RTMP streams.
      Returns:
      The BroadcastProperties.Builder object with the list of RtmpProperties setting.
      Throws:
      InvalidArgumentException
    • resolution

      public BroadcastProperties.Builder resolution(String resolution)
      Sets the resolution of the broadcast stream.
      Parameters:
      resolution - The resolution of the broadcast, either "640x480" (SD, the default), "1280x720" (HD) or "1920x1080" (FHD).
      Returns:
      The BroadcastProperties.Builder object with the resolution setting.
    • streamMode

      public BroadcastProperties.Builder streamMode(Broadcast.StreamMode streamMode)
      Sets the stream mode for this broadcast When streams are selected automatically (StreamMode.AUTO, the default), all streams in the session can be included in the archive. When streams are selected manually (StreamMode.MANUAL), you specify streams to be included based on calls to the OpenTok.addBroadcastStream(String, String, boolean, boolean) and OpenTok.removeBroadcastStream(String, String) methods. With StreamMode.MANUAL, you can specify whether a stream's audio, video, or both are included in the archive. Un both automatic and manual modes, the archive composer includes streams based on stream prioritization rules.
      Parameters:
      streamMode - Set to a value defined in the Broadcast.StreamMode enum.
      Returns:
      The BroadcastProperties.Builder object with the stream mode string.
    • multiBroadcastTag

      public BroadcastProperties.Builder multiBroadcastTag(String multiBroadcastTag)
      Set this to support multiple broadcasts for the same session simultaneously. Set this to a unique string for each simultaneous broadcast of an ongoing session. See Simultaneous Broadcasts documentation.
      Parameters:
      multiBroadcastTag - A unique multi-broadcast tag.
      Returns:
      The BroadcastProperties.Builder object with the multiBroadcastTag setting.
    • build

      public BroadcastProperties build()
      Builds the BroadcastProperties object.
      Returns:
      The BroadcastProperties object.