Skip to content

Commit

Permalink
0.21.0 (#608)
Browse files Browse the repository at this point in the history
* - update native libraries to 2.22.3

* add enable DTX JS

* add enable DTX Native

* - fix typo ios OTSessionManager

* - fix default value for enableDtx

* 0.21.0

* - update changelog

* - fix sample test

* - set jvm option

* update gradle 6.9

* - fix gradlew dependencies
  • Loading branch information
Enrico Portolan authored Jun 15, 2022
1 parent 734c772 commit 6acac7d
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sample_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: NPM install ${{ matrix.project }}
run: |
cd samples/${{ matrix.project }}
npm install
npm install --legacy-peer-deps
npm install ../../new.tgz
cat package.json
- name: Build ${{ matrix.project }} ${{ matrix.platform }}
Expand All @@ -50,7 +50,7 @@ jobs:
cat Podfile.lock
xcodebuild clean build -quiet -workspace ${{ matrix.project }}.xcworkspace -scheme ${{ matrix.project }} -destination 'platform=iOS Simulator,name=iPhone 11,OS=15.0'
else
./gradlew app:assembleRelease
./gradlew -Dorg.gradle.jvmargs=-Xmx4g app:assembleRelease
fi
Expand Down
5 changes: 5 additions & 0 deletions @types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@ declare module "opentok-react-native" {
*/
cameraPosition?: "front" | "back";

/**
* Whether to enable Opus DTX. The default value is false. Setting this to true can reduce bandwidth usage in streams that have long periods of silence.
*/
enableDtx?: boolean;

/**
* The desired frame rate, in frames per second, of the video. Valid values are 30, 15, 7, and 1. The published stream will use the closest value supported on the publishing client. The frame rate can differ slightly from the value you set, depending on the device of the client. And the video will only use the desired frame rate if the client configuration supports it.
*/
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.21.0 (June 14, 2022)

- [Update]: Add DTX Option for Publisher
- [Update]: Android Native SDK to 2.22.3 and iOS to 2.22.3

# 0.20.3 (May 18, 2022)

- [Fix]: Updates from DependatBot
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:${_reactNativeVersion}" // From node_modules
implementation 'com.opentok.android:opentok-android-sdk:2.21.5'
implementation 'com.opentok.android:opentok-android-sdk:2.22.3'
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public void initPublisher(String publisherId, ReadableMap properties, Callback c
String cameraPosition = properties.getString("cameraPosition");
Boolean audioFallbackEnabled = properties.getBoolean("audioFallbackEnabled");
int audioBitrate = properties.getInt("audioBitrate");
Boolean enableDtx = properties.getBoolean("enableDtx");
String frameRate = "FPS_" + properties.getInt("frameRate");
String resolution = properties.getString("resolution");
Boolean publishAudio = properties.getBoolean("publishAudio");
Expand All @@ -163,6 +164,7 @@ public void initPublisher(String publisherId, ReadableMap properties, Callback c
.videoTrack(videoTrack)
.name(name)
.audioBitrate(audioBitrate)
.enableOpusDtx(enableDtx)
.resolution(Publisher.CameraCaptureResolution.valueOf(resolution))
.frameRate(Publisher.CameraCaptureFrameRate.valueOf(frameRate))
.capturer(capturer)
Expand Down
2 changes: 2 additions & 0 deletions docs/OTPublisher.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
* **audioTrack** (Boolean) — If this property is set to false, the audio subsystem will not be initialized for the publisher, and setting the publishAudio property will have no effect. If your application does not require the use of audio, it is recommended to set this property rather than use the publishAudio property, which only temporarily disables the audio track.

* **cameraPosition** (String) - The preferred camera position. When setting this property, if the change is possible, the publisher will use the camera with the specified position. Valid Inputs: 'front' or 'back'

* **enableDtx** (Boolean) - Whether to enable [Opus DTX](https://datatracker.ietf.org/doc/html/rfc7587#section-3.1.3). The default value is false. Setting this to true can reduce bandwidth usage in streams that have long periods of silence.

* **frameRate** (Number) - The desired frame rate, in frames per second, of the video. Valid values are 30, 15, 7, and 1. The published stream will use the closest value supported on the publishing client. The frame rate can differ slightly from the value you set, depending on the device of the client. And the video will only use the desired frame rate if the client configuration supports it.

Expand Down
1 change: 1 addition & 0 deletions ios/OpenTokReactNative/OTSessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class OTSessionManager: RCTEventEmitter {
}
publisherProperties.cameraFrameRate = Utils.sanitizeFrameRate(properties["frameRate"] as Any);
publisherProperties.cameraResolution = Utils.sanitizeCameraResolution(properties["resolution"] as Any);
publisherProperties.enableOpusDtx = Utils.sanitizeBooleanProperty(properties["enableDtx"] as Any);
publisherProperties.name = properties["name"] as? String;
publisherProperties.videoCapture?.videoContentHint = Utils.convertVideoContentHint(properties["videoContentHint"] as Any)
OTRN.sharedState.publishers.updateValue(OTPublisher(delegate: self, settings: publisherProperties)!, forKey: publisherId);
Expand Down
2 changes: 1 addition & 1 deletion opentok-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,swift}"

s.dependency 'React'
s.dependency 'OpenTok','~> 2.21.3'
s.dependency 'OpenTok','~> 2.22.3'
end
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opentok-react-native",
"version": "0.20.3",
"version": "0.21.0",
"description": "React Native components for OpenTok iOS and Android SDKs",
"main": "src/index.js",
"homepage": "https://www.tokbox.com",
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/OTPublisherHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const sanitizeProperties = (properties) => {
cameraPosition: 'front',
audioFallbackEnabled: true,
audioBitrate: 40000,
enableDtx: false,
frameRate: 30,
resolution: sanitizeResolution(),
videoContentHint: '',
Expand All @@ -72,6 +73,7 @@ const sanitizeProperties = (properties) => {
cameraPosition: sanitizeCameraPosition(properties.cameraPosition),
audioFallbackEnabled: sanitizeBooleanProperty(properties.audioFallbackEnabled),
audioBitrate: sanitizeAudioBitrate(properties.audioBitrate),
enableDtx: sanitizeBooleanProperty(properties.enableDtx ? properties.enableDtx : false),
frameRate: sanitizeFrameRate(properties.frameRate),
resolution: sanitizeResolution(properties.resolution),
videoContentHint: sanitizeVideoContentHint(properties.videoContentHint),
Expand Down

0 comments on commit 6acac7d

Please sign in to comment.