@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.
Files changed (50) hide show
  1. package/README.md +88 -57
  2. package/android/build.gradle +23 -14
  3. package/android/proguard-rules.pro +1 -1
  4. package/android/src/live/java/com/volcengine/reactnative/vertc/live/VertcLive.java +76 -8
  5. package/android/src/main/java/com/volcengine/reactnative/vertc/NativeVariableManager.java +0 -5
  6. package/android/src/main/java/com/volcengine/reactnative/vertc/ScreenCaptureHelper.java +13 -18
  7. package/android/src/main/java/com/volcengine/reactnative/vertc/VertcApiEngineManager.java +5 -5
  8. package/android/src/main/java/com/volcengine/reactnative/vertc/VertcHelper.java +30 -0
  9. package/android/src/main/java/com/volcengine/reactnative/vertc/VertcImpl.java +68 -0
  10. package/android/src/main/java/com/volcengine/reactnative/vertc/events/ClassHelper.java +24 -3
  11. package/android/src/main/java/com/volcengine/reactnative/vertc/events/IRTCRoomEventHandlerImpl.java +90 -11
  12. package/android/src/main/java/com/volcengine/reactnative/vertc/events/IRTCVideoEventHandlerImpl.java +65 -4
  13. package/android/src/newarch/com/volcengine/reactnative/vertc/VertcModule.java +86 -0
  14. package/android/src/{main/java → oldarch}/com/volcengine/reactnative/vertc/VertcModule.java +11 -17
  15. package/ios/core/RTCHeader.h +1 -0
  16. package/ios/core/VertcHelper.h +9 -3
  17. package/ios/core/VertcHelper.m +72 -1
  18. package/ios/live/VertcLive.m +164 -12
  19. package/ios/new_arch_core/RCTVertc.h +23 -0
  20. package/ios/new_arch_core/RCTVertc.mm +89 -0
  21. package/ios/new_arch_core/VertcImpl.h +33 -0
  22. package/ios/new_arch_core/VertcImpl.m +53 -0
  23. package/ios/new_arch_core/VertcViewManager.m +51 -0
  24. package/lib/commonjs/index.js +1609 -806
  25. package/lib/module/index.js +1608 -808
  26. package/lib/typescript/codegen/android/api.d.ts +152 -8
  27. package/lib/typescript/codegen/android/callback.d.ts +13 -5
  28. package/lib/typescript/codegen/android/keytype.d.ts +105 -7
  29. package/lib/typescript/codegen/ios/api.d.ts +152 -16
  30. package/lib/typescript/codegen/ios/callback.d.ts +65 -5
  31. package/lib/typescript/codegen/ios/keytype.d.ts +171 -5
  32. package/lib/typescript/codegen/pack/api.d.ts +94 -83
  33. package/lib/typescript/codegen/pack/callback.d.ts +158 -40
  34. package/lib/typescript/codegen/pack/keytype.d.ts +121 -21
  35. package/lib/typescript/interface.d.ts +43 -10
  36. package/lib/typescript/module.d.ts +7 -0
  37. package/lib/typescript/platforms/android/vertc.d.ts +4 -1
  38. package/lib/typescript/platforms/ios/vertc.d.ts +2 -1
  39. package/lib/typescript/platforms/turboModule/NativeVertc.d.ts +26 -0
  40. package/lib/typescript/platforms/turboModule/index.d.ts +4 -0
  41. package/lib/typescript/proxy.d.ts +1 -1
  42. package/lib/typescript/util.d.ts +1 -0
  43. package/package.json +11 -2
  44. package/react-native-rtc.podspec +35 -31
  45. package/src/platforms/turboModule/NativeVertc.ts +33 -0
  46. package/src/platforms/turboModule/index.ts +1 -0
  47. /package/android/src/{main/java → oldarch}/com/volcengine/reactnative/vertc/VertcModuleSpec.java +0 -0
  48. /package/ios/{core → original_arch_core}/VertcModule.h +0 -0
  49. /package/ios/{core → original_arch_core}/VertcModule.m +0 -0
  50. /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;
@@ -0,0 +1,4 @@
1
+ // Copyright © 2022 BytePlusRTC All rights reserved.
2
+ // SPDX-License-Identifier: MIT
3
+
4
+ export { default as NativeBridge } from './NativeVertc';
@@ -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;
@@ -16,3 +16,4 @@ export declare const platformBriefsSync: <T>({ android, ios, }: {
16
16
  android: INormalFunction<T>;
17
17
  ios: INormalFunction<T>;
18
18
  }) => Promise<T>;
19
+ export declare function isNewArch(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byteplus/react-native-rtc",
3
- "version": "1.1.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
  }
@@ -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 = 'ios/core/*.{h,m,mm,swift}'
51
+ core.source_files = core_list
44
52
  end
45
53
 
46
54
  s.subspec 'Live' do |sub|
47
- sub.source_files = [
48
- 'ios/core/*.{h,m,mm,swift}',
49
- 'ios/live/*.{h,m,mm,swift}'
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
- sub.source_files = [
55
- 'ios/core/*.{h,m,mm,swift}',
56
- 'ios/vod/*.{h,m,mm,swift}'
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
- s.dependency "React-Core"
66
-
67
- # Don't install the dependencies when we run `pod install` in the old architecture.
68
- if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
69
- s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
70
- s.pod_target_xcconfig.merge!({
71
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
72
- "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
73
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
74
- })
75
- s.dependency "React-Codegen"
76
- s.dependency "RCT-Folly"
77
- s.dependency "RCTRequired"
78
- s.dependency "RCTTypeSafety"
79
- s.dependency "ReactCommon/turbomodule/core"
80
- end
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.4'
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.6-alpha1-premium' : '1.46.300.6-alpha1-premium'
94
- rtc_default_version = is_bp ? '3.58.1.14800' : '3.58.1.100'
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';
File without changes
File without changes