Class Broadcast.Builder

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

public static class Broadcast.Builder extends StreamComposition.Builder
Used to construct a Broadcast object.
  • Method Details

    • streamMode

      (OPTIONAL) Whether streams included in the broadcast are selected automatically ("auto", the default) or manually ("manual"). When streams are selected automatically ("auto"), all streams in the session can be included in the broadcast. When streams are selected manually ("manual"), you specify which streams to include based on calls to VideoClient.addBroadcastStream(String, String, Boolean, Boolean). For both automatic and manual modes, the broadcast composer includes streams based on stream prioritization rules.
      Parameters:
      streamMode - The streaming mode as an enum.
      Returns:
      This builder.
    • resolution

      (OPTIONAL) The resolution of the broadcast: either "640x480" (SD landscape, the default), "1280x720" (HD landscape), "1920x1080" (FHD landscape), "480x640" (SD portrait), "720x1280" (HD portrait), or "1080x1920" (FHD portrait). You may want to use a portrait aspect ratio for broadcasts that include video streams from mobile devices (which often use the portrait aspect ratio).
      Parameters:
      resolution - The video resolution as an enum.
      Returns:
      This builder.
    • layout

      (OPTIONAL) Specify this to assign the initial layout type for the broadcast. If you do not specify an initial layout type, the broadcast stream uses the Best Fit layout type.
      Parameters:
      layout - The broadcast's initial layout properties.
      Returns:
      This builder.
    • addRtmpStream

      (OPTIONAL, but REQUIRED if HLS is unspecified) You can specify up to five target RTMP streams (or just one). For each RTMP stream, specify serverUrl (the RTMP server URL), streamName (the stream name, such as the YouTube Live stream name or the Facebook stream key), and (optionally) id (a unique ID for the stream). If you specify an ID, it will be included in the REST call response and the REST method for getting information about a live-streaming broadcast. Vonage streams the session to each RTMP URL you specify. Note that Vonage live-streaming supports RTMP and RTMPS.
      Parameters:
      rtmp - The RTMP stream to include in the broadcast.
      Returns:
      This builder.
    • rtmpStreams

      (OPTIONAL, but REQUIRED if HLS is unspecified) You can specify up to five target RTMP streams (or just one). For each RTMP stream, specify serverUrl (the RTMP server URL), streamName (the stream name, such as the YouTube Live stream name or the Facebook stream key), and (optionally) id (a unique ID for the stream). If you specify an ID, it will be included in the REST call response and the REST method for getting information about a live-streaming broadcast. Vonage streams the session to each RTMP URL you specify. Note that Vonage live-streaming supports RTMP and RTMPS.
      Parameters:
      rtmps - The RTMP streams to include in the broadcast.
      Returns:
      This builder.
      See Also:
    • hls

      public Broadcast.Builder hls(Hls hls)
      (OPTIONAL, but REQUIRED if no RTMP URLs are set) Sets the HTTP Live Streaming (HLS) output of the broadcast.
      Parameters:
      hls - The HLS broadcast properties.
      Returns:
      This builder.
    • maxBitrate

      public Broadcast.Builder maxBitrate(int maxBitrate)
      (OPTIONAL) The maximum bitrate for the broadcast, in bits per second.
      Parameters:
      maxBitrate - The maximum bitrate as an integer.
      Returns:
      This builder.
    • maxDuration

      public Broadcast.Builder maxDuration(int maxDuration)
      (OPTIONAL) The maximum duration for the broadcast, in seconds. 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 4 hours (14400 seconds).
      Parameters:
      maxDuration - The maximum duration as an integer.
      Returns:
      This builder.
    • maxDuration

      public Broadcast.Builder maxDuration(Duration maxDuration)
      (OPTIONAL) The maximum duration for the broadcast. The broadcast will automatically stop when the maximum duration is reached. You can set the maximum duration to a value from 60 seconds to 10 hours. The default maximum duration is 4 hours.
      Parameters:
      maxDuration - The maximum duration.
      Returns:
      This builder.
    • multiBroadcastTag

      public Broadcast.Builder multiBroadcastTag(String multiBroadcastTag)
      (OPTIONAL) 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.
      Parameters:
      multiBroadcastTag - The tag for this broadcast.
      Returns:
      This builder.
    • build

      public Broadcast build()
      Builds the Broadcast object with this builder's settings.
      Returns:
      A new Broadcast instance.