Skip to content

Commit d7801ac

Browse files
SMadanijeffswartz
andauthored
Merge dev into main (#242)
* Minor fixes in build.gradle * Added support for MultiBroadcastTag and MultiArchiveTag (#226) * Added multiArchiveTag * Added multiBroadcastTag * Updated docs * Removed getMulti*Tag from responses * Revert "Removed getMulti*Tag from responses" This reverts commit 6e7f123. * Docs edits re multiArchive/BroadcastTag. Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Add Experience Composer API (#227) * Added startRender * Added listRenders * Deserialize listRenders response to native List * Added stopRender & getRender * Use enum for Render status * Improved RenderProperties * Experience composer docs edits ... And other docs corrections Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Bump dependency versions * Improved release process. bump2version is now manual, but release to Nexus is fully automated. * Ensure version is passed in bumpversion.sh * Bumped dependencies (including WireMock) * Bump version: v4.8.0 → v4.8.1 * Update copyright year * Use wiremock-jre8 * Boost coverage * Boost coverage * Disable codecov temporarily * Revert "Disable codecov temporarily" This reverts commit 613bff0. * Add Audio Streamer (lite) API endpoint (#215) * Added Audio Streamer (lite) endpoint * Don't include headers or streams if empty in connect request * Renamed Connect for clarity * Addressed PR comments * Fixed failing test * URI in AudioStreamerConnectionProperties constructor * Docs edits * Bumped dependencies (notably WireMock to 2.x) * Bumped dependencies * Bump dependency versions (#233) Improved release process, bumped dependency versions (including WireMock), slightly improved test coverage, updated copyright year, merged main, ready for release v4.8.1. * Renamed to Audio Connector * Bumped dependencies * Added audio connector to README * Minor docs edits --------- Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Bump version: v4.8.1 → v4.9.0 * Minor docs edit * Enable custom User-Agent (#238) * Add end-to-end encryption support (#237) * Added e2ee support * Added validation for SessionProperties * Only include e2ee if true * Update SessionProperties javadoc Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Minor docs edit --------- Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Bump jackson version * Bump version: v4.9.0 → v4.10.0 * Auto archive resolution & name (#241) * Prepare v4.10.0 release (#240) * Minor fixes in build.gradle * Added support for MultiBroadcastTag and MultiArchiveTag (#226) * Added multiArchiveTag * Added multiBroadcastTag * Updated docs * Removed getMulti*Tag from responses * Revert "Removed getMulti*Tag from responses" This reverts commit 6e7f123. * Docs edits re multiArchive/BroadcastTag. Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Add Experience Composer API (#227) * Added startRender * Added listRenders * Deserialize listRenders response to native List * Added stopRender & getRender * Use enum for Render status * Improved RenderProperties * Experience composer docs edits ... And other docs corrections Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Bump dependency versions * Improved release process. bump2version is now manual, but release to Nexus is fully automated. * Ensure version is passed in bumpversion.sh * Bumped dependencies (including WireMock) * Bump version: v4.8.0 → v4.8.1 * Update copyright year * Use wiremock-jre8 * Boost coverage * Boost coverage * Disable codecov temporarily * Revert "Disable codecov temporarily" This reverts commit 613bff0. * Add Audio Streamer (lite) API endpoint (#215) * Added Audio Streamer (lite) endpoint * Don't include headers or streams if empty in connect request * Renamed Connect for clarity * Addressed PR comments * Fixed failing test * URI in AudioStreamerConnectionProperties constructor * Docs edits * Bumped dependencies (notably WireMock to 2.x) * Bumped dependencies * Bump dependency versions (#233) Improved release process, bumped dependency versions (including WireMock), slightly improved test coverage, updated copyright year, merged main, ready for release v4.8.1. * Renamed to Audio Connector * Bumped dependencies * Added audio connector to README * Minor docs edits --------- Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Bump version: v4.8.1 → v4.9.0 * Minor docs edit * Enable custom User-Agent (#238) * Add end-to-end encryption support (#237) * Added e2ee support * Added validation for SessionProperties * Only include e2ee if true * Update SessionProperties javadoc Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Minor docs edit --------- Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Bump jackson version * Bump version: v4.9.0 → v4.10.0 --------- Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Added auto archive properties to session * Updated resolution names --------- Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com> * Add hasAudio and hasVideo to Broadcast (#239) * Bump version: v4.10.0 → v4.11.0 * Remove dev from DEVELOPING.MD --------- Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com>
1 parent 9e897d1 commit d7801ac

File tree

12 files changed

+318
-55
lines changed

12 files changed

+318
-55
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[bumpversion]
22
commit = True
33
tag = False
4-
current_version = v4.10.0
4+
current_version = v4.11.0
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
66
serialize =
77
{major}.{minor}.{patch}-{release}{build}

DEVELOPING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ During development the version number should end in "-alpha.x" or "-beta.x", whe
8181

8282
### Branches
8383

84-
* `dev` - the main development branch.
85-
* `master` - reflects the latest stable release.
84+
* `main` - the main development branch.
8685
* `feat.foo` - feature branches. these are used for longer running tasks that cannot be accomplished in one commit.
8786
once merged into master, these branches should be deleted.
8887
* `vx.x.x` - if development for a future version/milestone has begun while master is working towards a sooner

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ When you use Maven as your build tool, you can manage dependencies in the `pom.x
3434
<dependency>
3535
<groupId>com.tokbox</groupId>
3636
<artifactId>opentok-server-sdk</artifactId>
37-
<version>4.10.0</version>
37+
<version>4.11.0</version>
3838
</dependency>
3939
```
4040

@@ -44,7 +44,7 @@ When you use Gradle as your build tool, you can manage dependencies in the `buil
4444

4545
```groovy
4646
dependencies {
47-
compile group: 'com.tokbox', name: 'opentok-server-sdk', version: '4.10.0'
47+
compile group: 'com.tokbox', name: 'opentok-server-sdk', version: '4.11.0'
4848
}
4949
```
5050

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111

1212
group = 'com.tokbox'
1313
archivesBaseName = 'opentok-server-sdk'
14-
version = '4.10.0'
14+
version = '4.11.0'
1515
sourceCompatibility = "1.8"
1616
targetCompatibility = "1.8"
1717

@@ -27,10 +27,10 @@ dependencies {
2727
implementation 'commons-lang:commons-lang:2.6'
2828
implementation 'commons-validator:commons-validator:1.7'
2929
implementation 'org.asynchttpclient:async-http-client:2.12.3'
30-
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.0'
30+
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
3131
implementation 'commons-codec:commons-codec:1.15'
3232
implementation 'org.bitbucket.b_c:jose4j:0.9.3'
33-
implementation 'io.netty:netty-handler:4.1.89.Final'
33+
implementation 'io.netty:netty-handler:4.1.93.Final'
3434
}
3535

3636
task sourcesJar(type: Jar) {

src/main/java/com/opentok/Broadcast.java

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,17 @@ public enum StreamMode {
3434
*/
3535
AUTO,
3636
/**
37-
* Strams will be included in the archive based on calls to the
37+
* Streams will be included in the archive based on calls to the
3838
* {@link OpenTok#addBroadcastStream(String, String, boolean, boolean)} and
3939
* {@link OpenTok#removeBroadcastStream(String, String)} methods.
4040
*/
4141
MANUAL;
4242

4343
@JsonValue
44-
public String toString() { return super.toString().toLowerCase(); }
44+
@Override
45+
public String toString() {
46+
return name().toLowerCase();
47+
}
4548
}
4649

4750
@JsonProperty private String id;
@@ -52,8 +55,10 @@ public enum StreamMode {
5255
@JsonProperty private String resolution;
5356
@JsonProperty private String status;
5457
@JsonProperty private String multiBroadcastTag;
58+
@JsonProperty private boolean hasAudio = true;
59+
@JsonProperty private boolean hasVideo = true;
5560
@JsonProperty private StreamMode streamMode = StreamMode.AUTO;
56-
private List<Rtmp> rtmpList = new ArrayList<>();
61+
private List<Rtmp> rtmpList = new ArrayList<>(5);
5762
private String hls;
5863

5964
/**
@@ -165,13 +170,18 @@ public List<Rtmp> getRtmpList() {
165170
return rtmpList;
166171
}
167172

168-
@Override
169-
public String toString() {
170-
try {
171-
return new ObjectMapper().writeValueAsString(this);
172-
} catch (JsonProcessingException e) {
173-
return "";
174-
}
173+
/**
174+
* Whether the broadcast has audio (<code>true</code>) or not (<code>false</code>).
175+
*/
176+
public boolean hasAudio() {
177+
return hasAudio;
178+
}
179+
180+
/**
181+
* Whether the broadcast has video (<code>true</code>) or not (<code>false</code>).
182+
*/
183+
public boolean hasVideo() {
184+
return hasVideo;
175185
}
176186

177187
/**
@@ -182,4 +192,12 @@ public StreamMode getStreamMode() {
182192
return streamMode;
183193
}
184194

195+
@Override
196+
public String toString() {
197+
try {
198+
return new ObjectMapper().writeValueAsString(this);
199+
} catch (JsonProcessingException e) {
200+
return "";
201+
}
202+
}
185203
}

src/main/java/com/opentok/BroadcastProperties.java

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,23 @@
1919
* {@link OpenTok#startBroadcast(String sessionId, BroadcastProperties properties)} method.
2020
*/
2121
public class BroadcastProperties {
22-
private BroadcastLayout layout;
23-
private int maxDuration;
24-
private boolean hasHls;
25-
private List<RtmpProperties> rtmpList;
26-
private String resolution;
27-
private String multiBroadcastTag;
28-
private StreamMode streamMode;
29-
private Hls hls;
22+
private final BroadcastLayout layout;
23+
private final int maxDuration;
24+
private final boolean hasHls;
25+
private final boolean hasAudio;
26+
private final boolean hasVideo;
27+
private final List<RtmpProperties> rtmpList;
28+
private final String resolution;
29+
private final String multiBroadcastTag;
30+
private final StreamMode streamMode;
31+
private final Hls hls;
3032

3133
private BroadcastProperties(Builder builder) {
3234
this.layout = builder.layout;
3335
this.maxDuration = builder.maxDuration;
3436
this.hasHls = builder.hasHls;
37+
this.hasAudio = builder.hasAudio;
38+
this.hasVideo = builder.hasVideo;
3539
this.hls = builder.hls;
3640
this.rtmpList = builder.rtmpList;
3741
this.resolution = builder.resolution;
@@ -48,9 +52,11 @@ public static class Builder {
4852
private BroadcastLayout layout = new BroadcastLayout(BroadcastLayout.Type.BESTFIT);
4953
private int maxDuration = 7200;
5054
private boolean hasHls = false;
55+
private boolean hasAudio = true;
56+
private boolean hasVideo = true;
5157
private String multiBroadcastTag;
5258
private Hls hls;
53-
private List<RtmpProperties> rtmpList = new ArrayList<>();
59+
private final List<RtmpProperties> rtmpList = new ArrayList<>(5);
5460
private String resolution = "640x480";
5561
private StreamMode streamMode = StreamMode.AUTO;
5662

@@ -107,6 +113,30 @@ public Builder hls(Hls hls) {
107113
return hasHls((this.hls = hls) != null);
108114
}
109115

116+
/**
117+
* Whether to include audio in the broadcast ({@code true} by default).
118+
*
119+
* @param hasAudio {@code true} if audio should be included, {@code false} otherwise.
120+
*
121+
* @return The BroadcastProperties.Builder object with the hasAudio setting.
122+
*/
123+
public Builder hasAudio(boolean hasAudio) {
124+
this.hasAudio = hasAudio;
125+
return this;
126+
}
127+
128+
/**
129+
* Whether to include video in the broadcast ({@code true} by default).
130+
*
131+
* @param hasVideo {@code true} if video should be included, {@code false} otherwise.
132+
*
133+
* @return The BroadcastProperties.Builder object with the hasVideo setting.
134+
*/
135+
public Builder hasVideo(boolean hasVideo) {
136+
this.hasVideo = hasVideo;
137+
return this;
138+
}
139+
110140
/**
111141
* Call this method to set a list of RTMP broadcast streams. There is a limit of
112142
* 5 RTMP streams.
@@ -115,7 +145,7 @@ public Builder hls(Hls hls) {
115145
*
116146
* @return The BroadcastProperties.Builder object with the list of RtmpProperties setting.
117147
*/
118-
public Builder addRtmpProperties (RtmpProperties rtmpProps) throws InvalidArgumentException {
148+
public Builder addRtmpProperties(RtmpProperties rtmpProps) throws InvalidArgumentException {
119149
if (this.rtmpList.size() >= 5) {
120150
throw new InvalidArgumentException("Cannot add more than 5 RtmpProperties properties");
121151
}
@@ -206,6 +236,20 @@ public boolean hasHls() {
206236
return hasHls;
207237
}
208238

239+
/**
240+
* Whether the broadcast has audio (<code>true</code>) or not (<code>false</code>).
241+
*/
242+
public boolean hasAudio() {
243+
return hasAudio;
244+
}
245+
246+
/**
247+
* Whether the broadcast has video (<code>true</code>) or not (<code>false</code>).
248+
*/
249+
public boolean hasVideo() {
250+
return hasVideo;
251+
}
252+
209253
/**
210254
* The HLS configuration object, or <code>null</code> if {@link BroadcastProperties#hasHls} is false.
211255
*/
@@ -219,6 +263,7 @@ public Hls hls() {
219263
public List<RtmpProperties> rtmpList() {
220264
return rtmpList;
221265
}
266+
222267
/**
223268
* Returns the resolution of the broadcast.
224269
*/
@@ -236,5 +281,7 @@ public String getMultiBroadcastTag() {
236281
/**
237282
* The stream mode of the broadcast.
238283
*/
239-
public StreamMode streamMode() { return streamMode; }
284+
public StreamMode streamMode() {
285+
return streamMode;
286+
}
240287
}

src/main/java/com/opentok/Hls.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* {@link BroadcastProperties#hls()} method.
1414
*/
1515
public class Hls {
16-
1716
private final boolean dvr;
1817
private final boolean lowLatency;
1918

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/**
2+
* OpenTok Java SDK
3+
* Copyright (C) 2023 Vonage.
4+
* http://www.tokbox.com
5+
*
6+
* Licensed under The MIT License (MIT). See LICENSE file for more information.
7+
*/
8+
package com.opentok;
9+
10+
import com.fasterxml.jackson.annotation.JsonCreator;
11+
import com.fasterxml.jackson.annotation.JsonValue;
12+
import java.util.Arrays;
13+
import java.util.Map;
14+
import java.util.function.Function;
15+
import java.util.stream.Collectors;
16+
17+
/**
18+
* Defines valid video resolutions.
19+
*/
20+
public enum Resolution {
21+
/**
22+
* 480p landscape (640x480)
23+
*/
24+
SD_HORIZONTAL("640x480"),
25+
26+
/**
27+
* 480p portrait (480x640)
28+
*/
29+
SD_VERTICAL("480x640"),
30+
31+
/**
32+
* 720p landscape (1280x720)
33+
*/
34+
HD_HORIZONTAL("1280x720"),
35+
36+
/**
37+
* 720p portrait (720x1280)
38+
*/
39+
HD_VERTICAL("720x1280"),
40+
41+
/**
42+
* 1080p landscape (1920x1080)
43+
*/
44+
FHD_HORIZONTAL("1920x1080"),
45+
46+
/**
47+
* 1080p portrait (1080x1920)
48+
*/
49+
FHD_VERTICAL("1080x1920");
50+
51+
private static final Map<String, Resolution> RESOLUTION_INDEX =
52+
Arrays.stream(Resolution.values()).collect(Collectors.toMap(
53+
Resolution::toString, Function.identity()
54+
));
55+
56+
private final String value;
57+
58+
Resolution(String value) {
59+
this.value = value;
60+
}
61+
62+
@JsonValue
63+
@Override
64+
public String toString() {
65+
return value;
66+
}
67+
68+
@JsonCreator
69+
public static Resolution fromString(String resolution) {
70+
return RESOLUTION_INDEX.getOrDefault(resolution, null);
71+
}
72+
}

0 commit comments

Comments
 (0)