Skip to content

Commit

Permalink
Merge dev into main (#242)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* Minor docs edit

---------

Co-authored-by: Jeff Swartz <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* Minor docs edit

---------

Co-authored-by: Jeff Swartz <[email protected]>

* Bump jackson version

* Bump version: v4.9.0 → v4.10.0

---------

Co-authored-by: Jeff Swartz <[email protected]>

* Added auto archive properties to session

* Updated resolution names

---------

Co-authored-by: Jeff Swartz <[email protected]>

* 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 <[email protected]>
  • Loading branch information
SMadani and jeffswartz authored Jun 6, 2023
1 parent 9e897d1 commit d7801ac
Show file tree
Hide file tree
Showing 12 changed files with 318 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[bumpversion]
commit = True
tag = False
current_version = v4.10.0
current_version = v4.11.0
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
serialize =
{major}.{minor}.{patch}-{release}{build}
Expand Down
3 changes: 1 addition & 2 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ During development the version number should end in "-alpha.x" or "-beta.x", whe

### Branches

* `dev` - the main development branch.
* `master` - reflects the latest stable release.
* `main` - the main development branch.
* `feat.foo` - feature branches. these are used for longer running tasks that cannot be accomplished in one commit.
once merged into master, these branches should be deleted.
* `vx.x.x` - if development for a future version/milestone has begun while master is working towards a sooner
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ When you use Maven as your build tool, you can manage dependencies in the `pom.x
<dependency>
<groupId>com.tokbox</groupId>
<artifactId>opentok-server-sdk</artifactId>
<version>4.10.0</version>
<version>4.11.0</version>
</dependency>
```

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

```groovy
dependencies {
compile group: 'com.tokbox', name: 'opentok-server-sdk', version: '4.10.0'
compile group: 'com.tokbox', name: 'opentok-server-sdk', version: '4.11.0'
}
```

Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {

group = 'com.tokbox'
archivesBaseName = 'opentok-server-sdk'
version = '4.10.0'
version = '4.11.0'
sourceCompatibility = "1.8"
targetCompatibility = "1.8"

Expand All @@ -27,10 +27,10 @@ dependencies {
implementation 'commons-lang:commons-lang:2.6'
implementation 'commons-validator:commons-validator:1.7'
implementation 'org.asynchttpclient:async-http-client:2.12.3'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
implementation 'commons-codec:commons-codec:1.15'
implementation 'org.bitbucket.b_c:jose4j:0.9.3'
implementation 'io.netty:netty-handler:4.1.89.Final'
implementation 'io.netty:netty-handler:4.1.93.Final'
}

task sourcesJar(type: Jar) {
Expand Down
38 changes: 28 additions & 10 deletions src/main/java/com/opentok/Broadcast.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ public enum StreamMode {
*/
AUTO,
/**
* Strams will be included in the archive based on calls to the
* Streams will be included in the archive based on calls to the
* {@link OpenTok#addBroadcastStream(String, String, boolean, boolean)} and
* {@link OpenTok#removeBroadcastStream(String, String)} methods.
*/
MANUAL;

@JsonValue
public String toString() { return super.toString().toLowerCase(); }
@Override
public String toString() {
return name().toLowerCase();
}
}

@JsonProperty private String id;
Expand All @@ -52,8 +55,10 @@ public enum StreamMode {
@JsonProperty private String resolution;
@JsonProperty private String status;
@JsonProperty private String multiBroadcastTag;
@JsonProperty private boolean hasAudio = true;
@JsonProperty private boolean hasVideo = true;
@JsonProperty private StreamMode streamMode = StreamMode.AUTO;
private List<Rtmp> rtmpList = new ArrayList<>();
private List<Rtmp> rtmpList = new ArrayList<>(5);
private String hls;

/**
Expand Down Expand Up @@ -165,13 +170,18 @@ public List<Rtmp> getRtmpList() {
return rtmpList;
}

@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException e) {
return "";
}
/**
* Whether the broadcast has audio (<code>true</code>) or not (<code>false</code>).
*/
public boolean hasAudio() {
return hasAudio;
}

/**
* Whether the broadcast has video (<code>true</code>) or not (<code>false</code>).
*/
public boolean hasVideo() {
return hasVideo;
}

/**
Expand All @@ -182,4 +192,12 @@ public StreamMode getStreamMode() {
return streamMode;
}

@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException e) {
return "";
}
}
}
69 changes: 58 additions & 11 deletions src/main/java/com/opentok/BroadcastProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,23 @@
* {@link OpenTok#startBroadcast(String sessionId, BroadcastProperties properties)} method.
*/
public class BroadcastProperties {
private BroadcastLayout layout;
private int maxDuration;
private boolean hasHls;
private List<RtmpProperties> rtmpList;
private String resolution;
private String multiBroadcastTag;
private StreamMode streamMode;
private Hls hls;
private final BroadcastLayout layout;
private final int maxDuration;
private final boolean hasHls;
private final boolean hasAudio;
private final boolean hasVideo;
private final List<RtmpProperties> rtmpList;
private final String resolution;
private final String multiBroadcastTag;
private final StreamMode streamMode;
private final Hls hls;

private BroadcastProperties(Builder builder) {
this.layout = builder.layout;
this.maxDuration = builder.maxDuration;
this.hasHls = builder.hasHls;
this.hasAudio = builder.hasAudio;
this.hasVideo = builder.hasVideo;
this.hls = builder.hls;
this.rtmpList = builder.rtmpList;
this.resolution = builder.resolution;
Expand All @@ -48,9 +52,11 @@ public static class Builder {
private BroadcastLayout layout = new BroadcastLayout(BroadcastLayout.Type.BESTFIT);
private int maxDuration = 7200;
private boolean hasHls = false;
private boolean hasAudio = true;
private boolean hasVideo = true;
private String multiBroadcastTag;
private Hls hls;
private List<RtmpProperties> rtmpList = new ArrayList<>();
private final List<RtmpProperties> rtmpList = new ArrayList<>(5);
private String resolution = "640x480";
private StreamMode streamMode = StreamMode.AUTO;

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

/**
* Whether to include audio in the broadcast ({@code true} by default).
*
* @param hasAudio {@code true} if audio should be included, {@code false} otherwise.
*
* @return The BroadcastProperties.Builder object with the hasAudio setting.
*/
public Builder hasAudio(boolean hasAudio) {
this.hasAudio = hasAudio;
return this;
}

/**
* Whether to include video in the broadcast ({@code true} by default).
*
* @param hasVideo {@code true} if video should be included, {@code false} otherwise.
*
* @return The BroadcastProperties.Builder object with the hasVideo setting.
*/
public Builder hasVideo(boolean hasVideo) {
this.hasVideo = hasVideo;
return this;
}

/**
* Call this method to set a list of RTMP broadcast streams. There is a limit of
* 5 RTMP streams.
Expand All @@ -115,7 +145,7 @@ public Builder hls(Hls hls) {
*
* @return The BroadcastProperties.Builder object with the list of RtmpProperties setting.
*/
public Builder addRtmpProperties (RtmpProperties rtmpProps) throws InvalidArgumentException {
public Builder addRtmpProperties(RtmpProperties rtmpProps) throws InvalidArgumentException {
if (this.rtmpList.size() >= 5) {
throw new InvalidArgumentException("Cannot add more than 5 RtmpProperties properties");
}
Expand Down Expand Up @@ -206,6 +236,20 @@ public boolean hasHls() {
return hasHls;
}

/**
* Whether the broadcast has audio (<code>true</code>) or not (<code>false</code>).
*/
public boolean hasAudio() {
return hasAudio;
}

/**
* Whether the broadcast has video (<code>true</code>) or not (<code>false</code>).
*/
public boolean hasVideo() {
return hasVideo;
}

/**
* The HLS configuration object, or <code>null</code> if {@link BroadcastProperties#hasHls} is false.
*/
Expand All @@ -219,6 +263,7 @@ public Hls hls() {
public List<RtmpProperties> rtmpList() {
return rtmpList;
}

/**
* Returns the resolution of the broadcast.
*/
Expand All @@ -236,5 +281,7 @@ public String getMultiBroadcastTag() {
/**
* The stream mode of the broadcast.
*/
public StreamMode streamMode() { return streamMode; }
public StreamMode streamMode() {
return streamMode;
}
}
1 change: 0 additions & 1 deletion src/main/java/com/opentok/Hls.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* {@link BroadcastProperties#hls()} method.
*/
public class Hls {

private final boolean dvr;
private final boolean lowLatency;

Expand Down
72 changes: 72 additions & 0 deletions src/main/java/com/opentok/Resolution.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/**
* OpenTok Java SDK
* Copyright (C) 2023 Vonage.
* http://www.tokbox.com
*
* Licensed under The MIT License (MIT). See LICENSE file for more information.
*/
package com.opentok;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
* Defines valid video resolutions.
*/
public enum Resolution {
/**
* 480p landscape (640x480)
*/
SD_HORIZONTAL("640x480"),

/**
* 480p portrait (480x640)
*/
SD_VERTICAL("480x640"),

/**
* 720p landscape (1280x720)
*/
HD_HORIZONTAL("1280x720"),

/**
* 720p portrait (720x1280)
*/
HD_VERTICAL("720x1280"),

/**
* 1080p landscape (1920x1080)
*/
FHD_HORIZONTAL("1920x1080"),

/**
* 1080p portrait (1080x1920)
*/
FHD_VERTICAL("1080x1920");

private static final Map<String, Resolution> RESOLUTION_INDEX =
Arrays.stream(Resolution.values()).collect(Collectors.toMap(
Resolution::toString, Function.identity()
));

private final String value;

Resolution(String value) {
this.value = value;
}

@JsonValue
@Override
public String toString() {
return value;
}

@JsonCreator
public static Resolution fromString(String resolution) {
return RESOLUTION_INDEX.getOrDefault(resolution, null);
}
}
Loading

0 comments on commit d7801ac

Please sign in to comment.