2121public class BroadcastProperties {
2222 private final BroadcastLayout layout ;
2323 private final int maxDuration ;
24+ private final int maxBitrate ;
2425 private final boolean hasHls ;
2526 private final boolean hasAudio ;
2627 private final boolean hasVideo ;
@@ -31,16 +32,17 @@ public class BroadcastProperties {
3132 private final Hls hls ;
3233
3334 private BroadcastProperties (Builder builder ) {
34- this .layout = builder .layout ;
35- this .maxDuration = builder .maxDuration ;
36- this .hasHls = builder .hasHls ;
37- this .hasAudio = builder .hasAudio ;
38- this .hasVideo = builder .hasVideo ;
39- this .hls = builder .hls ;
40- this .rtmpList = builder .rtmpList ;
41- this .resolution = builder .resolution ;
42- this .streamMode = builder .streamMode ;
43- this .multiBroadcastTag = builder .multiBroadcastTag ;
35+ layout = builder .layout ;
36+ maxDuration = builder .maxDuration ;
37+ maxBitrate = builder .maxBitrate ;
38+ hasHls = builder .hasHls ;
39+ hasAudio = builder .hasAudio ;
40+ hasVideo = builder .hasVideo ;
41+ hls = builder .hls ;
42+ rtmpList = builder .rtmpList ;
43+ resolution = builder .resolution ;
44+ streamMode = builder .streamMode ;
45+ multiBroadcastTag = builder .multiBroadcastTag ;
4446 }
4547
4648 /**
@@ -51,6 +53,7 @@ private BroadcastProperties(Builder builder) {
5153 public static class Builder {
5254 private BroadcastLayout layout = new BroadcastLayout (BroadcastLayout .Type .BESTFIT );
5355 private int maxDuration = 7200 ;
56+ private int maxBitrate = 2_000_000 ;
5457 private boolean hasHls = false ;
5558 private boolean hasAudio = true ;
5659 private boolean hasVideo = true ;
@@ -67,7 +70,7 @@ public static class Builder {
6770 *
6871 * @return The BroadcastProperties.Builder object with the layout setting.
6972 */
70- public Builder layout (BroadcastLayout layout ){
73+ public Builder layout (BroadcastLayout layout ) {
7174 this .layout = layout ;
7275 return this ;
7376 }
@@ -82,14 +85,31 @@ public Builder layout(BroadcastLayout layout){
8285 *
8386 * @return The BroadcastProperties.Builder object with the maxDuration setting.
8487 */
85- public Builder maxDuration (int maxDuration ) throws InvalidArgumentException {
86- if (maxDuration < 60 || maxDuration > 36000 ) {
88+ public Builder maxDuration (int maxDuration ) throws InvalidArgumentException {
89+ if (maxDuration < 60 || maxDuration > 36_000 ) {
8790 throw new InvalidArgumentException ("maxDuration value must be between 60 and 36000 (inclusive)." );
8891 }
8992 this .maxDuration = maxDuration ;
9093 return this ;
9194 }
9295
96+ /**
97+ * Sets the maximum bitrate in bits per second for broadcast composing.
98+ *
99+ * @param maxBitrate The maximum bitrate in bits per second.
100+ *
101+ * @return The BroadcastProperties.Builder object with the maxBitrate setting.
102+ *
103+ * @throws InvalidArgumentException If the bitrate is out of bounds.
104+ */
105+ public Builder maxBitrate (int maxBitrate ) throws InvalidArgumentException {
106+ if (maxBitrate < 100_000 || maxBitrate > 6_000_000 ) {
107+ throw new InvalidArgumentException ("maxBitrate value must be between 100_000 and 6_000_000." );
108+ }
109+ this .maxBitrate = maxBitrate ;
110+ return this ;
111+ }
112+
93113 /**
94114 * Call this method to include an HLS broadcast (<code>true</code>) or not <code>false</code>).
95115 *
@@ -229,6 +249,13 @@ public int maxDuration() {
229249 return maxDuration ;
230250 }
231251
252+ /**
253+ * The maximum bitrate in bits per second of the broadcast.
254+ */
255+ public int maxBitrate () {
256+ return maxBitrate ;
257+ }
258+
232259 /**
233260 * Whether the broadcast has HLS (<code>true</code>) or not (<code>false</code>).
234261 */
0 commit comments