@byteplus/react-native-live-push 1.0.2 → 1.0.3-rc.0

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 (32) hide show
  1. package/android/build.gradle +2 -2
  2. package/android/src/main/java/com/volcengine/velive/rn/push/NativeVariableManager.java +1 -1
  3. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushModule.java +5 -3
  4. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushViewManager.java +10 -5
  5. package/ios/VeLivePushView.m +1 -1
  6. package/ios/VeLivePushViewManager.m +5 -1
  7. package/lib/commonjs/index.js +21799 -17839
  8. package/lib/module/index.js +21799 -17832
  9. package/lib/typescript/android/index.d.ts +3 -0
  10. package/lib/typescript/codegen/android/api.d.ts +1350 -75
  11. package/lib/typescript/codegen/android/keytype.d.ts +439 -62
  12. package/lib/typescript/codegen/android/types.d.ts +7 -6
  13. package/lib/typescript/codegen/ios/api.d.ts +11 -19
  14. package/lib/typescript/codegen/ios/callback.d.ts +17 -25
  15. package/lib/typescript/codegen/ios/external.d.ts +1 -0
  16. package/lib/typescript/codegen/ios/index.d.ts +1 -0
  17. package/lib/typescript/codegen/ios/keytype.d.ts +6 -34
  18. package/lib/typescript/codegen/ios/types.d.ts +16 -5
  19. package/lib/typescript/codegen/pack/api.d.ts +1250 -1216
  20. package/lib/typescript/codegen/pack/callback.d.ts +153 -295
  21. package/lib/typescript/codegen/pack/errorcode.d.ts +11 -150
  22. package/lib/typescript/codegen/pack/index.d.ts +1 -1
  23. package/lib/typescript/codegen/pack/keytype.d.ts +806 -1366
  24. package/lib/typescript/codegen/pack/types.d.ts +67 -0
  25. package/lib/typescript/component.d.ts +10 -3
  26. package/lib/typescript/core/api.d.ts +2 -2
  27. package/lib/typescript/core/callback.d.ts +2 -2
  28. package/lib/typescript/core/errorcode.d.ts +2 -2
  29. package/lib/typescript/core/keytype.d.ts +2 -7
  30. package/lib/typescript/platforms/ios/extends.d.ts +17 -0
  31. package/package.json +2 -1
  32. package/react-native-velive-push.podspec +3 -3
@@ -87,6 +87,6 @@ dependencies {
87
87
  // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
88
88
  //noinspection GradleDynamicVersion
89
89
  implementation "com.facebook.react:react-native:+"
90
- implementation "com.volcengine:VolcApiEngine:1.0.3"
91
- implementation 'com.bytedanceapi:ttsdk-ttlivepush_rtc:1.41.3.4'
90
+ implementation "com.volcengine:VolcApiEngine:1.2.3"
91
+ implementation 'com.bytedanceapi:ttsdk-ttlivepush_rtc:1.41.300.103'
92
92
  }
@@ -3,7 +3,7 @@ package com.volcengine.velive.rn.push;
3
3
  import androidx.annotation.NonNull;
4
4
 
5
5
  import com.facebook.react.bridge.ReactApplicationContext;
6
- import com.volcengine.VolcApiEngine.runtime.*;
6
+ import com.volcengine.VolcApiEngine.*;
7
7
 
8
8
  public class NativeVariableManager {
9
9
  static void init(@NonNull VolcApiEngine apiEngine, ReactApplicationContext reactContext) {
@@ -3,6 +3,7 @@ package com.volcengine.velive.rn.push;
3
3
  import static com.volcengine.VolcApiEngine.runtime.Util.JsonAbleClass;
4
4
 
5
5
  import android.util.Log;
6
+ import android.view.View;
6
7
 
7
8
  import androidx.annotation.Nullable;
8
9
 
@@ -18,12 +19,13 @@ import com.facebook.react.modules.core.DeviceEventManagerModule;
18
19
  import com.ss.avframework.live.VeLivePusherConfiguration;
19
20
  import com.ss.avframework.live.VeLivePusherDef;
20
21
  import com.ss.avframework.live.VeLivePusherObserver;
21
- import com.volcengine.VolcApiEngine.runtime.*;
22
+ import com.ss.avframework.live.statistics.VeLivePusherStatisticsExt;
23
+ import com.volcengine.VolcApiEngine.*;
22
24
  import com.volcengine.VolcApiEngine.view.*;
23
25
 
24
26
  public class VeLivePushModule extends VeLivePushModuleSpec implements IEventReceiver {
25
27
  static {
26
- JsonAbleClass.add(VeLivePusherDef.VeLivePusherStatistics.class);
28
+ JsonAbleClass.add(VeLivePusherStatisticsExt.class);
27
29
  }
28
30
 
29
31
  VolcApiEngine apiEngine = null;
@@ -176,7 +178,7 @@ public class VeLivePushModule extends VeLivePushModuleSpec implements IEventRece
176
178
  }
177
179
  });
178
180
 
179
- mLivePusher.setRenderView(VolcViewManager.getViewById("live-pusher"));
181
+ mLivePusher.setRenderView((View) VolcViewManager.getViewById("live-pusher"));
180
182
  mLivePusher.startVideoCapture(VeLivePusherDef.VeLiveVideoCaptureType.VeLiveVideoCaptureFrontCamera);
181
183
  }
182
184
  }
@@ -1,5 +1,6 @@
1
1
  package com.volcengine.velive.rn.push;
2
2
 
3
+ import android.os.Looper;
3
4
  import android.view.SurfaceView;
4
5
  import android.view.View;
5
6
 
@@ -15,7 +16,7 @@ import com.volcengine.VolcApiEngine.view.*;
15
16
 
16
17
  import java.util.Map;
17
18
 
18
- public class VeLivePushViewManager extends SimpleViewManager<VeLivePushView> implements VolcViewManagerInterface<VeLivePushView> {
19
+ public class VeLivePushViewManager extends SimpleViewManager<VeLivePushView> {
19
20
  public static final String NAME = "VeLivePushView";
20
21
 
21
22
  private ThemedReactContext context;
@@ -28,9 +29,13 @@ public class VeLivePushViewManager extends SimpleViewManager<VeLivePushView> imp
28
29
 
29
30
  @NonNull
30
31
  @Override
31
- public VeLivePushView createViewInstance(@NonNull ThemedReactContext themedReactContext) {
32
- context = themedReactContext;
33
- return new VeLivePushView(themedReactContext);
32
+ protected VeLivePushView createViewInstance(@NonNull ThemedReactContext reactContext) {
33
+ // 确保在主线程创建
34
+ if (Looper.myLooper() != Looper.getMainLooper()) {
35
+ throw new IllegalStateException("View must be created on the main thread");
36
+ }
37
+ context = reactContext;
38
+ return new VeLivePushView(reactContext);
34
39
  }
35
40
 
36
41
  @ReactProp(name = "viewId")
@@ -80,7 +85,7 @@ public class VeLivePushViewManager extends SimpleViewManager<VeLivePushView> imp
80
85
  "load",
81
86
  MapBuilder.of(
82
87
  "phasedRegistrationNames",
83
- MapBuilder.of("bubbled", "onLoad")
88
+ MapBuilder.of("bubbled", "onViewLoad")
84
89
  )
85
90
  ).build();
86
91
  }
@@ -30,7 +30,7 @@
30
30
  [self emitLoaded];
31
31
  }
32
32
 
33
- - (void) setOnLoad:(RCTBubblingEventBlock)onLoad {
33
+ - (void) setOnViewLoad:(RCTBubblingEventBlock)onLoad {
34
34
  _onLoad = onLoad;
35
35
 
36
36
  [self emitLoaded];
@@ -16,10 +16,14 @@
16
16
 
17
17
  @implementation VeLivePushViewManager
18
18
 
19
+ + (BOOL)requiresMainQueueSetup {
20
+ return YES;
21
+ }
22
+
19
23
  RCT_EXPORT_MODULE(VeLivePushView)
20
24
 
21
25
  // 导出 events
22
- RCT_EXPORT_VIEW_PROPERTY(onLoad, RCTBubblingEventBlock)
26
+ RCT_EXPORT_VIEW_PROPERTY(onViewLoad, RCTBubblingEventBlock)
23
27
 
24
28
  // 导出 events
25
29
  RCT_CUSTOM_VIEW_PROPERTY(viewId, NSString, VeLivePushUIView)