@byteplus/react-native-rtc 1.1.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -57
- package/android/build.gradle +23 -14
- package/android/proguard-rules.pro +1 -1
- package/android/src/live/java/com/volcengine/reactnative/vertc/live/VertcLive.java +76 -8
- package/android/src/main/java/com/volcengine/reactnative/vertc/NativeVariableManager.java +0 -5
- package/android/src/main/java/com/volcengine/reactnative/vertc/ScreenCaptureHelper.java +13 -18
- package/android/src/main/java/com/volcengine/reactnative/vertc/VertcApiEngineManager.java +5 -5
- package/android/src/main/java/com/volcengine/reactnative/vertc/VertcHelper.java +30 -0
- package/android/src/main/java/com/volcengine/reactnative/vertc/VertcImpl.java +68 -0
- package/android/src/main/java/com/volcengine/reactnative/vertc/events/ClassHelper.java +24 -3
- package/android/src/main/java/com/volcengine/reactnative/vertc/events/IRTCRoomEventHandlerImpl.java +90 -11
- package/android/src/main/java/com/volcengine/reactnative/vertc/events/IRTCVideoEventHandlerImpl.java +65 -4
- package/android/src/newarch/com/volcengine/reactnative/vertc/VertcModule.java +86 -0
- package/android/src/{main/java → oldarch}/com/volcengine/reactnative/vertc/VertcModule.java +11 -17
- package/ios/core/RTCHeader.h +1 -0
- package/ios/core/VertcHelper.h +9 -3
- package/ios/core/VertcHelper.m +72 -1
- package/ios/live/VertcLive.m +164 -12
- package/ios/new_arch_core/RCTVertc.h +23 -0
- package/ios/new_arch_core/RCTVertc.mm +89 -0
- package/ios/new_arch_core/VertcImpl.h +33 -0
- package/ios/new_arch_core/VertcImpl.m +53 -0
- package/ios/new_arch_core/VertcViewManager.m +51 -0
- package/lib/commonjs/index.js +1609 -806
- package/lib/module/index.js +1608 -808
- package/lib/typescript/codegen/android/api.d.ts +152 -8
- package/lib/typescript/codegen/android/callback.d.ts +13 -5
- package/lib/typescript/codegen/android/keytype.d.ts +105 -7
- package/lib/typescript/codegen/ios/api.d.ts +152 -16
- package/lib/typescript/codegen/ios/callback.d.ts +65 -5
- package/lib/typescript/codegen/ios/keytype.d.ts +171 -5
- package/lib/typescript/codegen/pack/api.d.ts +94 -83
- package/lib/typescript/codegen/pack/callback.d.ts +158 -40
- package/lib/typescript/codegen/pack/keytype.d.ts +121 -21
- package/lib/typescript/interface.d.ts +43 -10
- package/lib/typescript/module.d.ts +7 -0
- package/lib/typescript/platforms/android/vertc.d.ts +4 -1
- package/lib/typescript/platforms/ios/vertc.d.ts +2 -1
- package/lib/typescript/platforms/turboModule/NativeVertc.d.ts +26 -0
- package/lib/typescript/platforms/turboModule/index.d.ts +4 -0
- package/lib/typescript/proxy.d.ts +1 -1
- package/lib/typescript/util.d.ts +1 -0
- package/package.json +11 -2
- package/react-native-rtc.podspec +35 -31
- package/src/platforms/turboModule/NativeVertc.ts +33 -0
- package/src/platforms/turboModule/index.ts +1 -0
- /package/android/src/{main/java → oldarch}/com/volcengine/reactnative/vertc/VertcModuleSpec.java +0 -0
- /package/ios/{core → original_arch_core}/VertcModule.h +0 -0
- /package/ios/{core → original_arch_core}/VertcModule.m +0 -0
- /package/ios/{core → original_arch_core}/VertcViewManager.m +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright © 2022 BytePlusRTC All rights reserved.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import type { TurboModule } from 'react-native';
|
|
5
|
+
export interface Spec extends TurboModule {
|
|
6
|
+
/**
|
|
7
|
+
* 异步调用原生方法
|
|
8
|
+
* @param params 调用参数
|
|
9
|
+
* @returns 调用结果
|
|
10
|
+
*/
|
|
11
|
+
callSync(params: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* 同步调用原生方法
|
|
14
|
+
* @param params 调用参数
|
|
15
|
+
* @param callback 结果回调函数
|
|
16
|
+
*/
|
|
17
|
+
call(params: string, callback: (res: string) => void): void;
|
|
18
|
+
newApiEngine(): boolean;
|
|
19
|
+
addListener: (eventType: string) => void;
|
|
20
|
+
removeListeners: (count: number) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 获取NativeBridgeModule实例
|
|
24
|
+
*/
|
|
25
|
+
declare const _default: Spec | null;
|
|
26
|
+
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright © 2022 BytePlusRTC All rights reserved.
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
|
-
import { RTCRoom, RTCVideo, IAudioEffectPlayer, IMediaPlayer } from './codegen/pack';
|
|
4
|
+
import { RTCRoom, RTCVideo, IAudioEffectPlayer, IMediaPlayer } from './codegen/pack/index';
|
|
5
5
|
import { IEngine, IRoom, I_AudioEffectPlayer, I_MediaPlayer } from './interface';
|
|
6
6
|
export declare const proxyEngine: (engine: RTCVideo | IEngine) => IEngine;
|
|
7
7
|
export declare const proxyRoom: (room: RTCRoom | IRoom) => IRoom;
|
package/lib/typescript/util.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byteplus/react-native-rtc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "*",
|
|
6
6
|
"react-native": "*"
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"ios",
|
|
15
15
|
"*.podspec",
|
|
16
16
|
"lib",
|
|
17
|
+
"src/platforms/turboModule",
|
|
17
18
|
"!readme",
|
|
18
19
|
"!**/__tests__",
|
|
19
20
|
"!**/__fixtures__",
|
|
@@ -29,5 +30,13 @@
|
|
|
29
30
|
],
|
|
30
31
|
"author": "vcloud-fe",
|
|
31
32
|
"description": "volcengine sdk for react native",
|
|
32
|
-
"homepage": "https://www.volcengine.com"
|
|
33
|
+
"homepage": "https://www.volcengine.com",
|
|
34
|
+
"codegenConfig": {
|
|
35
|
+
"name": "VertcSpec",
|
|
36
|
+
"type": "modules",
|
|
37
|
+
"jsSrcsDir": "src/platforms/turboModule",
|
|
38
|
+
"android": {
|
|
39
|
+
"javaPackageName": "com.volcengine.reactnative.vertc"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
33
42
|
}
|
package/react-native-rtc.podspec
CHANGED
|
@@ -13,6 +13,14 @@ if File.exist?(project_package_json_path) then
|
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
core_list = ['ios/core/*.{h,m,mm,swift}']
|
|
17
|
+
|
|
18
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
19
|
+
core_list += ['ios/new_arch_core/*.{h,m,mm,swift}']
|
|
20
|
+
else
|
|
21
|
+
core_list += ['ios/original_arch_core/*.{h,m,mm,swift}']
|
|
22
|
+
end
|
|
23
|
+
|
|
16
24
|
Pod::Spec.new do |s|
|
|
17
25
|
s.name = "react-native-rtc"
|
|
18
26
|
s.version = package["version"]
|
|
@@ -40,44 +48,40 @@ Pod::Spec.new do |s|
|
|
|
40
48
|
s.default_subspec = 'Core'
|
|
41
49
|
|
|
42
50
|
s.subspec 'Core' do |core|
|
|
43
|
-
core.source_files =
|
|
51
|
+
core.source_files = core_list
|
|
44
52
|
end
|
|
45
53
|
|
|
46
54
|
s.subspec 'Live' do |sub|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
]
|
|
55
|
+
source_files = [ 'ios/live/*.{h,m,mm,swift}' ]
|
|
56
|
+
source_files += core_list
|
|
57
|
+
sub.source_files = source_files
|
|
51
58
|
end
|
|
52
59
|
|
|
53
60
|
s.subspec 'Vod' do |sub|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
]
|
|
61
|
+
source_files = [ 'ios/vod/*.{h,m,mm,swift}' ]
|
|
62
|
+
source_files += core_list
|
|
63
|
+
sub.source_files = source_files
|
|
58
64
|
end
|
|
59
65
|
|
|
60
|
-
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
61
|
-
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
62
66
|
if respond_to?(:install_modules_dependencies, true)
|
|
63
|
-
install_modules_dependencies(s)
|
|
67
|
+
install_modules_dependencies(s);
|
|
64
68
|
else
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
70
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
71
|
+
s.pod_target_xcconfig.merge!({
|
|
72
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
73
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
74
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
75
|
+
})
|
|
76
|
+
s.dependency "React-Codegen"
|
|
77
|
+
s.dependency "RCT-Folly"
|
|
78
|
+
s.dependency "RCTRequired"
|
|
79
|
+
s.dependency "RCTTypeSafety"
|
|
80
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
81
|
+
else
|
|
82
|
+
# React-Core will be installed by default when using original Arch. (0.71+)
|
|
83
|
+
s.dependency "React-Core"
|
|
84
|
+
end
|
|
81
85
|
end
|
|
82
86
|
|
|
83
87
|
enable_union_live = (ENV['ENABLE_UNION_FOR_RTC_WITH_LIVE'] == 'YES')
|
|
@@ -86,12 +90,12 @@ Pod::Spec.new do |s|
|
|
|
86
90
|
target_vod_version = ENV['UNION_FOR_RTC_WITH_VOD_VERSION']
|
|
87
91
|
target_volc_api_engine_version = ENV['VOLC_API_ENGINE_VERSION_FOR_RTC']
|
|
88
92
|
|
|
89
|
-
s.dependency 'VolcApiEngine', target_volc_api_engine_version || '1.6.
|
|
93
|
+
s.dependency 'VolcApiEngine', target_volc_api_engine_version || '1.6.6'
|
|
90
94
|
|
|
91
95
|
rtc_sdk_name = is_bp ? 'BytePlusRTC' : 'VolcEngineRTC'
|
|
92
96
|
|
|
93
|
-
rtc_live_unique_version = is_bp ? '1.46.300.
|
|
94
|
-
rtc_default_version = is_bp ? '3.58.1.
|
|
97
|
+
rtc_live_unique_version = is_bp ? '1.46.300.7-premium' : '1.46.3.10-premium'
|
|
98
|
+
rtc_default_version = is_bp ? '3.58.1.52500' : '3.58.1.51400'
|
|
95
99
|
|
|
96
100
|
vod_player_sr_version = is_bp ? '1.45.300.3-premium' : '1.46.2.8-premium'
|
|
97
101
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
import {TurboModuleRegistry} from 'react-native';
|
|
3
|
+
import type {TurboModule} from 'react-native';
|
|
4
|
+
|
|
5
|
+
export interface Spec extends TurboModule {
|
|
6
|
+
/**
|
|
7
|
+
* 异步调用原生方法
|
|
8
|
+
* @param params 调用参数
|
|
9
|
+
* @returns 调用结果
|
|
10
|
+
*/
|
|
11
|
+
callSync(params: string): string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 同步调用原生方法
|
|
15
|
+
* @param params 调用参数
|
|
16
|
+
* @param callback 结果回调函数
|
|
17
|
+
*/
|
|
18
|
+
call(params: string, callback: (res: string) => void): void;
|
|
19
|
+
|
|
20
|
+
newApiEngine(): boolean;
|
|
21
|
+
|
|
22
|
+
//
|
|
23
|
+
//eventEmitter See: https://github.com/reactwg/react-native-new-architecture/discussions/144
|
|
24
|
+
|
|
25
|
+
//Note: The addListener and removeListeners implementations will be provided by React Native.
|
|
26
|
+
addListener: (eventType: string) => void;
|
|
27
|
+
removeListeners: (count: number) => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 获取NativeBridgeModule实例
|
|
32
|
+
*/
|
|
33
|
+
export default TurboModuleRegistry.get<Spec>('Vertc') as Spec | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as NativeBridge} from './NativeVertc';
|
/package/android/src/{main/java → oldarch}/com/volcengine/reactnative/vertc/VertcModuleSpec.java
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|