Skip to content

Commit

Permalink
Merge pull request #316 from AgoraIO-Community/rc/3.2.+
Browse files Browse the repository at this point in the history
Rc/3.2.+
  • Loading branch information
LichKing-2234 authored Dec 23, 2020
2 parents c374b94 + a98f6bd commit 16f11d5
Show file tree
Hide file tree
Showing 31 changed files with 1,520 additions and 529 deletions.
98 changes: 98 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
version: 2.1

executors:
default:
docker:
- image: circleci/node:10
working_directory: ~/project

commands:
attach_project:
steps:
- attach_workspace:
at: ~/project

jobs:
install-dependencies:
executor: default
steps:
- checkout
- attach_project
- restore_cache:
keys:
- dependencies-{{ checksum "package.json" }}
- dependencies-
- restore_cache:
keys:
- dependencies-example-{{ checksum "example/package.json" }}
- dependencies-example-
- run:
name: Install dependencies
command: |
yarn install --cwd example --frozen-lockfile
yarn install --frozen-lockfile
- save_cache:
key: dependencies-{{ checksum "package.json" }}
paths: node_modules
- save_cache:
key: dependencies-example-{{ checksum "example/package.json" }}
paths: example/node_modules
- persist_to_workspace:
root: .
paths: .

lint:
executor: default
steps:
- attach_project
- run:
name: Lint files
command: |
yarn lint
typescript:
executor: default
steps:
- attach_project
- run:
name: Typecheck files
command: |
yarn typescript
unit-tests:
executor: default
steps:
- attach_project
- run:
name: Run unit tests
command: |
yarn test --coverage
- store_artifacts:
path: coverage
destination: coverage

build-package:
executor: default
steps:
- attach_project
- run:
name: Build package
command: |
yarn prepare
workflows:
build-and-test:
jobs:
- install-dependencies
- lint:
requires:
- install-dependencies
- typescript:
requires:
- install-dependencies
- unit-tests:
requires:
- install-dependencies
- build-package:
requires:
- install-dependencies
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# [3.2.0](https://github.com/AgoraIO-Community/react-native-agora/compare/v3.2.0-rc.0...v3.2.0) (2020-12-23)


### Features

* upgrade native SDK to 3.2.1 ([3dcc489](https://github.com/AgoraIO-Community/react-native-agora/commit/3dcc489bb52daaf8a794554f6048f343cbff5d8f))

# [3.2.0-rc.0](https://github.com/AgoraIO-Community/react-native-agora/compare/v3.1.6...v3.2.0-rc.0) (2020-12-21)


### Features

* add `setClientRole(role: ClientRole, options?: ClientRoleOptions): Promise<void>` ([721604e](https://github.com/AgoraIO-Community/react-native-agora/commit/721604ee94c3f7e3a0485b5b5db7fb5973e30665))
* add `setClientRole(role: ClientRole, options?: ClientRoleOptions): Promise<void>` ([2fef3ae](https://github.com/AgoraIO-Community/react-native-agora/commit/2fef3aee038b31808af53cee80a0fddc8d444fe8))
* add `setClientRole(role: ClientRole, options?: ClientRoleOptions): Promise<void>` ([3a55997](https://github.com/AgoraIO-Community/react-native-agora/commit/3a55997db81dcd16e68ee551d69b9079ff8052b0))
* upgrade to 3.2.0 ([fcb57cc](https://github.com/AgoraIO-Community/react-native-agora/commit/fcb57cc3e2cbb3e16750e9ce8ddca069184ac1c0))
* upgrade to 3.2.0 ([4ee51a9](https://github.com/AgoraIO-Community/react-native-agora/commit/4ee51a9b405deb17b467f5359f6717033c3961a2))
* upgrade to 3.2.0 ([680048f](https://github.com/AgoraIO-Community/react-native-agora/commit/680048f7836940f586ce7228559ba2cde9e0de62))

## [3.1.6](https://github.com/AgoraIO-Community/react-native-agora/compare/v3.1.5...v3.1.6) (2020-12-21)


Expand Down
18 changes: 9 additions & 9 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ repositories {
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
} else {
defaultDir = new File(
projectDir,
'/../../../node_modules/react-native/android'
projectDir,
'/../../../node_modules/react-native/android'
)
}

Expand All @@ -86,13 +86,13 @@ repositories {
parentDir = parentDir.parentFile

def androidSourcesDir = new File(
parentDir,
'node_modules/react-native'
parentDir,
'node_modules/react-native'
)

def androidPrebuiltBinaryDir = new File(
parentDir,
'node_modules/react-native/android'
parentDir,
'node_modules/react-native/android'
)

if (androidPrebuiltBinaryDir.exists()) {
Expand All @@ -117,8 +117,8 @@ repositories {

if (!found) {
throw new GradleException(
"${project.name}: unable to locate React Native android sources. " +
"Ensure you have you installed React Native as a dependency in your project and try again."
"${project.name}: unable to locate React Native android sources. " +
"Ensure you have you installed React Native as a dependency in your project and try again."
)
}
}
Expand All @@ -128,7 +128,7 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
dependencies {
// noinspection GradleDynamicVersion
api 'com.facebook.react:react-native:+'
api "io.agora.rtc:full-sdk:3.1.3"
api "io.agora.rtc:full-sdk:3.2.1"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
}
28 changes: 14 additions & 14 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="io.agora.rtc.react">
xmlns:tools="http://schemas.android.com/tools"
package="io.agora.rtc.react">

<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
tools:ignore="ProtectedPermissions" />

</manifest>
81 changes: 75 additions & 6 deletions android/src/main/java/io/agora/rtc/base/Annotations.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ public class Annotations {
AgoraRtcAppType.FLUTTER,
AgoraRtcAppType.UNREAL,
AgoraRtcAppType.XAMARIN,
AgoraRtcAppType.APICLOUD,
AgoraRtcAppType.REACTNATIVE,
AgoraRtcAppType.API_CLOUD,
AgoraRtcAppType.REACT_NATIVE,
AgoraRtcAppType.PYTHON,
AgoraRtcAppType.COCOS_CREATOR,
AgoraRtcAppType.RUST,
AgoraRtcAppType.C_SHARP,
AgoraRtcAppType.CEF,
AgoraRtcAppType.UNI_APP,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraRtcAppType {
Expand All @@ -32,8 +38,14 @@ public class Annotations {
int FLUTTER = 4;
int UNREAL = 5;
int XAMARIN = 6;
int APICLOUD = 7;
int REACTNATIVE = 8;
int API_CLOUD = 7;
int REACT_NATIVE = 8;
int PYTHON = 9;
int COCOS_CREATOR = 10;
int RUST = 11;
int C_SHARP = 12;
int CEF = 13;
int UNI_APP = 14;
}

@IntDef({
Expand Down Expand Up @@ -217,6 +229,8 @@ public class Annotations {
Constants.AUDIO_SCENARIO_GAME_STREAMING,
Constants.AUDIO_SCENARIO_SHOWROOM,
Constants.AUDIO_SCENARIO_CHATROOM_GAMING,
Constants.AUDIO_SCENARIO_IOT,
Constants.AUDIO_SCENARIO_MEETING,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraAudioScenario {
Expand Down Expand Up @@ -614,7 +628,7 @@ public class Annotations {

@IntDef({
Constants.USER_PRIORITY_HIGH,
Constants.USER_PRIORITY_NORANL,
Constants.USER_PRIORITY_NORMAL,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraUserPriority {
Expand Down Expand Up @@ -751,7 +765,11 @@ public class Annotations {
Constants.WARN_ADM_RECORD_IS_OCCUPIED,
Constants.WARN_APM_HOWLING,
Constants.WARN_ADM_GLITCH_STATE,
Constants.WARN_APM_RESIDUAL_ECHO,
// TODO(3.3.0) WARN_APM_RESIDUAL_ECHO
Constants.WARN_ADM_IMPROPER_SETTINGS,
Constants.WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION,
Constants.WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION,
Constants.WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraWarningCode {
Expand Down Expand Up @@ -796,4 +814,55 @@ public class Annotations {
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraRtmpStreamingEvent {
}

@IntDef({
Constants.AUDIO_EFFECT_OFF,
Constants.ROOM_ACOUSTICS_KTV,
Constants.ROOM_ACOUSTICS_VOCAL_CONCERT,
Constants.ROOM_ACOUSTICS_STUDIO,
Constants.ROOM_ACOUSTICS_PHONOGRAPH,
Constants.ROOM_ACOUSTICS_VIRTUAL_STEREO,
Constants.ROOM_ACOUSTICS_SPACIAL,
Constants.ROOM_ACOUSTICS_ETHEREAL,
Constants.ROOM_ACOUSTICS_3D_VOICE,
Constants.VOICE_CHANGER_EFFECT_UNCLE,
Constants.VOICE_CHANGER_EFFECT_OLDMAN,
Constants.VOICE_CHANGER_EFFECT_BOY,
Constants.VOICE_CHANGER_EFFECT_SISTER,
Constants.VOICE_CHANGER_EFFECT_GIRL,
Constants.VOICE_CHANGER_EFFECT_PIGKING,
Constants.VOICE_CHANGER_EFFECT_HULK,
Constants.STYLE_TRANSFORMATION_RNB,
Constants.STYLE_TRANSFORMATION_POPULAR,
Constants.PITCH_CORRECTION,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraAudioEffectPreset {
}

@IntDef({
Constants.VOICE_BEAUTIFIER_OFF,
Constants.CHAT_BEAUTIFIER_MAGNETIC,
Constants.CHAT_BEAUTIFIER_FRESH,
Constants.CHAT_BEAUTIFIER_VITALITY,
Constants.TIMBRE_TRANSFORMATION_VIGOROUS,
Constants.TIMBRE_TRANSFORMATION_DEEP,
Constants.TIMBRE_TRANSFORMATION_MELLOW,
Constants.TIMBRE_TRANSFORMATION_FALSETTO,
Constants.TIMBRE_TRANSFORMATION_FULL,
Constants.TIMBRE_TRANSFORMATION_CLEAR,
Constants.TIMBRE_TRANSFORMATION_RESOUNDING,
Constants.TIMBRE_TRANSFORMATION_RINGING,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraVoiceBeautifierPreset {
}

@IntDef({
Constants.AUDIENCE_LATENCY_LEVEL_LOW_LATENCY,
Constants.AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AgoraAudienceLatencyLevelType {
}
}
7 changes: 7 additions & 0 deletions android/src/main/java/io/agora/rtc/base/BeanCovertor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import io.agora.rtc.live.LiveInjectStreamConfig
import io.agora.rtc.live.LiveTranscoding
import io.agora.rtc.live.LiveTranscoding.TranscodingUser
import io.agora.rtc.models.ChannelMediaOptions
import io.agora.rtc.models.ClientRoleOptions
import io.agora.rtc.video.*

fun mapToVideoDimensions(map: Map<*, *>): VideoEncoderConfiguration.VideoDimensions {
Expand Down Expand Up @@ -177,3 +178,9 @@ fun mapToEncryptionConfig(map: Map<*, *>): EncryptionConfig {
(map["encryptionKey"] as? String)?.let { encryptionKey = it }
}
}

fun mapToClientRoleOptions(map: Map<*, *>): ClientRoleOptions {
return ClientRoleOptions().apply {
(map["audienceLatencyLevel"] as? Number)?.let { audienceLatencyLevel = it.toInt() }
}
}
7 changes: 6 additions & 1 deletion android/src/main/java/io/agora/rtc/base/RtcChannel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ class RtcChannelManager(
}

override fun setClientRole(params: Map<String, *>, callback: Callback) {
callback.code(this[params["channelId"] as String]?.setClientRole((params["role"] as Number).toInt()))
val role = (params["role"] as Number).toInt()
(params["options"] as? Map<*, *>)?.let {
callback.code(this[params["channelId"] as String]?.setClientRole(role, mapToClientRoleOptions(it)))
return@setClientRole
}
callback.code(this[params["channelId"] as String]?.setClientRole(role))
}

override fun joinChannel(params: Map<String, *>, callback: Callback) {
Expand Down
Loading

0 comments on commit 16f11d5

Please sign in to comment.