Package com.opentok
Class BroadcastProperties.Builder
java.lang.Object
com.opentok.BroadcastProperties.Builder
- Enclosing class:
- BroadcastProperties
Used to create a BroadcastProperties object.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRtmpProperties
(RtmpProperties rtmpProps) Call this method to set a list of RTMP broadcast streams.build()
Builds the BroadcastProperties object.hasAudio
(boolean hasAudio) Whether to include audio in the broadcast (true
by default).hasHls
(boolean hasHls) Call this method to include an HLS broadcast (true
) or notfalse
).hasVideo
(boolean hasVideo) Whether to include video in the broadcast (true
by default).Call this method to include HLS options.layout
(BroadcastLayout layout) Customizes the layout of the broadcast.maxBitrate
(int maxBitrate) Sets the maximum bitrate in bits per second for broadcast composing.maxDuration
(int maxDuration) Sets the maximum duration, in seconds, of the broadcast.multiBroadcastTag
(String multiBroadcastTag) Set this to support multiple broadcasts for the same session simultaneously.resolution
(String resolution) Sets the resolution of the broadcast stream.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.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
layout
Customizes the layout of the broadcast.- Parameters:
layout
- An object of typeBroadcastLayout
.- Returns:
- The BroadcastProperties.Builder object with the layout setting.
-
maxDuration
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
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
Call this method to include an HLS broadcast (true
) or notfalse
).- Parameters:
hasHls
- Whether the HLS broadcast is enabled or not.- Returns:
- The BroadcastProperties.Builder object with the HLS setting.
-
hls
Call this method to include HLS options. This will sethasHls
totrue
.- Parameters:
hls
- The HLS object.- Returns:
- The BroadcastProperties.Builder object with HLS populated.
-
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
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
- TheRtmpProperties
object defining the RTMP streams.- Returns:
- The BroadcastProperties.Builder object with the list of RtmpProperties setting.
- Throws:
InvalidArgumentException
-
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
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 theOpenTok.addBroadcastStream(String, String, boolean, boolean)
andOpenTok.removeBroadcastStream(String, String)
methods. WithStreamMode.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 theBroadcast.StreamMode
enum.- Returns:
- The BroadcastProperties.Builder object with the stream mode 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
Builds the BroadcastProperties object.- Returns:
- The BroadcastProperties object.
-