@volcengine/react-native-live-push 1.1.3-rc.1 → 1.2.0-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 (139) hide show
  1. package/android/build.gradle +2 -2
  2. package/android/src/main/java/com/volcengine/velive/rn/push/ClassHelper.java +9 -0
  3. package/android/src/main/java/com/volcengine/velive/rn/push/NativeVariableManager.java +5 -8
  4. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushModule.java +14 -2
  5. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushPackage.java +16 -13
  6. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushView.java +16 -0
  7. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushViewManager.java +7 -2
  8. package/android/src/main/java/com/volcengine/velive/rn/push/mixer/MixerManager.java +410 -0
  9. package/android/src/main/java/com/volcengine/velive/rn/push/mixer/MixerView.java +434 -0
  10. package/android/src/main/java/com/volcengine/velive/rn/push/mixer/MixerViewManager.java +79 -0
  11. package/android/src/main/java/com/volcengine/velive/rn/push/mixer/TextureMgr.java +168 -0
  12. package/android/src/main/java/com/volcengine/velive/rn/push/mixer/YuvHelper.java +165 -0
  13. package/ios/VeLiveMixerHelper.h +46 -0
  14. package/ios/VeLiveMixerHelper.m +620 -0
  15. package/ios/VeLiveMixerView.h +69 -0
  16. package/ios/VeLiveMixerView.m +600 -0
  17. package/ios/VeLiveMixerViewManager.m +92 -0
  18. package/lib/commonjs/index.js +22698 -20359
  19. package/lib/commonjs/typescript/android/index.d.ts +44 -0
  20. package/lib/commonjs/typescript/codegen/android/api.d.ts +1068 -0
  21. package/lib/commonjs/typescript/codegen/android/callback.d.ts +333 -0
  22. package/lib/commonjs/typescript/codegen/android/errorcode.d.ts +92 -0
  23. package/lib/commonjs/typescript/codegen/android/index.d.ts +5 -0
  24. package/lib/commonjs/typescript/codegen/android/keytype.d.ts +1693 -0
  25. package/lib/commonjs/typescript/codegen/android/types.d.ts +33 -0
  26. package/lib/commonjs/typescript/codegen/ios/api.d.ts +1125 -0
  27. package/lib/commonjs/typescript/codegen/ios/callback.d.ts +242 -0
  28. package/lib/commonjs/typescript/codegen/ios/errorcode.d.ts +154 -0
  29. package/lib/commonjs/typescript/codegen/ios/external.d.ts +1 -0
  30. package/lib/commonjs/typescript/codegen/ios/index.d.ts +6 -0
  31. package/lib/commonjs/typescript/codegen/ios/keytype.d.ts +1154 -0
  32. package/lib/commonjs/typescript/codegen/ios/types.d.ts +46 -0
  33. package/lib/commonjs/typescript/codegen/pack/api.d.ts +1470 -0
  34. package/lib/commonjs/typescript/codegen/pack/callback.d.ts +446 -0
  35. package/lib/commonjs/typescript/codegen/pack/errorcode.d.ts +109 -0
  36. package/lib/commonjs/typescript/codegen/pack/index.d.ts +5 -0
  37. package/lib/commonjs/typescript/codegen/pack/keytype.d.ts +2248 -0
  38. package/lib/commonjs/typescript/codegen/pack/types.d.ts +68 -0
  39. package/lib/commonjs/typescript/codegen/type-shim.d.ts +6 -0
  40. package/lib/commonjs/typescript/component.d.ts +15 -0
  41. package/lib/commonjs/typescript/core/api.d.ts +18 -0
  42. package/lib/commonjs/typescript/core/callback.d.ts +2 -0
  43. package/lib/commonjs/typescript/core/env.d.ts +29 -0
  44. package/lib/commonjs/typescript/core/errorcode.d.ts +2 -0
  45. package/lib/commonjs/typescript/core/index.d.ts +6 -0
  46. package/lib/commonjs/typescript/core/keytype.d.ts +18 -0
  47. package/lib/commonjs/typescript/core/mixer.d.ts +26 -0
  48. package/lib/commonjs/typescript/core/pusher.d.ts +13 -0
  49. package/lib/commonjs/typescript/index.d.ts +3 -0
  50. package/lib/commonjs/typescript/ios/extends.d.ts +41 -0
  51. package/lib/commonjs/typescript/platforms/android/extends.d.ts +8 -0
  52. package/lib/commonjs/typescript/platforms/android/helper.d.ts +8 -0
  53. package/lib/commonjs/typescript/platforms/android/mixer.d.ts +8 -0
  54. package/lib/commonjs/typescript/platforms/ios/extends.d.ts +17 -0
  55. package/lib/commonjs/typescript/platforms/ios/helper.d.ts +8 -0
  56. package/lib/commonjs/typescript/platforms/ios/mixer.d.ts +9 -0
  57. package/lib/commonjs/typescript/runtime.d.ts +1 -0
  58. package/lib/commonjs/typescript/view/MixView.d.ts +52 -0
  59. package/lib/commonjs/typescript/view/VeImageView.d.ts +19 -0
  60. package/lib/commonjs/typescript/view/VeTextView.d.ts +7 -0
  61. package/lib/commonjs/typescript/view/VeView.d.ts +7 -0
  62. package/lib/commonjs/typescript/view/VeWebView.d.ts +7 -0
  63. package/lib/commonjs/typescript/view/index.d.ts +5 -0
  64. package/lib/module/index.js +22695 -20360
  65. package/lib/module/typescript/android/index.d.ts +44 -0
  66. package/lib/module/typescript/codegen/android/api.d.ts +1068 -0
  67. package/lib/module/typescript/codegen/android/callback.d.ts +333 -0
  68. package/lib/module/typescript/codegen/android/errorcode.d.ts +92 -0
  69. package/lib/module/typescript/codegen/android/index.d.ts +5 -0
  70. package/lib/module/typescript/codegen/android/keytype.d.ts +1693 -0
  71. package/lib/module/typescript/codegen/android/types.d.ts +33 -0
  72. package/lib/module/typescript/codegen/ios/api.d.ts +1125 -0
  73. package/lib/module/typescript/codegen/ios/callback.d.ts +242 -0
  74. package/lib/module/typescript/codegen/ios/errorcode.d.ts +154 -0
  75. package/lib/module/typescript/codegen/ios/external.d.ts +1 -0
  76. package/lib/module/typescript/codegen/ios/index.d.ts +6 -0
  77. package/lib/module/typescript/codegen/ios/keytype.d.ts +1154 -0
  78. package/lib/module/typescript/codegen/ios/types.d.ts +46 -0
  79. package/lib/module/typescript/codegen/pack/api.d.ts +1470 -0
  80. package/lib/module/typescript/codegen/pack/callback.d.ts +446 -0
  81. package/lib/module/typescript/codegen/pack/errorcode.d.ts +109 -0
  82. package/lib/module/typescript/codegen/pack/index.d.ts +5 -0
  83. package/lib/module/typescript/codegen/pack/keytype.d.ts +2248 -0
  84. package/lib/module/typescript/codegen/pack/types.d.ts +68 -0
  85. package/lib/module/typescript/codegen/type-shim.d.ts +6 -0
  86. package/lib/module/typescript/component.d.ts +15 -0
  87. package/lib/module/typescript/core/api.d.ts +18 -0
  88. package/lib/module/typescript/core/callback.d.ts +2 -0
  89. package/lib/module/typescript/core/env.d.ts +29 -0
  90. package/lib/module/typescript/core/errorcode.d.ts +2 -0
  91. package/lib/module/typescript/core/index.d.ts +6 -0
  92. package/lib/module/typescript/core/keytype.d.ts +18 -0
  93. package/lib/module/typescript/core/mixer.d.ts +26 -0
  94. package/lib/module/typescript/core/pusher.d.ts +13 -0
  95. package/lib/module/typescript/index.d.ts +3 -0
  96. package/lib/module/typescript/ios/extends.d.ts +41 -0
  97. package/lib/module/typescript/platforms/android/extends.d.ts +8 -0
  98. package/lib/module/typescript/platforms/android/helper.d.ts +8 -0
  99. package/lib/module/typescript/platforms/android/mixer.d.ts +8 -0
  100. package/lib/module/typescript/platforms/ios/extends.d.ts +17 -0
  101. package/lib/module/typescript/platforms/ios/helper.d.ts +8 -0
  102. package/lib/module/typescript/platforms/ios/mixer.d.ts +9 -0
  103. package/lib/module/typescript/runtime.d.ts +1 -0
  104. package/lib/module/typescript/view/MixView.d.ts +52 -0
  105. package/lib/module/typescript/view/VeImageView.d.ts +19 -0
  106. package/lib/module/typescript/view/VeTextView.d.ts +7 -0
  107. package/lib/module/typescript/view/VeView.d.ts +7 -0
  108. package/lib/module/typescript/view/VeWebView.d.ts +7 -0
  109. package/lib/module/typescript/view/index.d.ts +5 -0
  110. package/lib/typescript/android/index.d.ts +0 -3
  111. package/lib/typescript/codegen/android/api.d.ts +194 -762
  112. package/lib/typescript/codegen/android/callback.d.ts +85 -48
  113. package/lib/typescript/codegen/android/errorcode.d.ts +30 -0
  114. package/lib/typescript/codegen/android/keytype.d.ts +514 -122
  115. package/lib/typescript/codegen/ios/api.d.ts +380 -351
  116. package/lib/typescript/codegen/ios/callback.d.ts +33 -6
  117. package/lib/typescript/codegen/ios/errorcode.d.ts +52 -2
  118. package/lib/typescript/codegen/ios/keytype.d.ts +313 -35
  119. package/lib/typescript/codegen/pack/api.d.ts +302 -821
  120. package/lib/typescript/codegen/pack/callback.d.ts +54 -49
  121. package/lib/typescript/codegen/pack/errorcode.d.ts +38 -5
  122. package/lib/typescript/codegen/pack/keytype.d.ts +672 -228
  123. package/lib/typescript/core/api.d.ts +18 -2
  124. package/lib/typescript/core/keytype.d.ts +16 -0
  125. package/lib/typescript/core/mixer.d.ts +26 -0
  126. package/lib/typescript/core/pusher.d.ts +0 -3
  127. package/lib/typescript/index.d.ts +1 -0
  128. package/lib/typescript/platforms/android/extends.d.ts +8 -0
  129. package/lib/typescript/platforms/android/mixer.d.ts +8 -0
  130. package/lib/typescript/platforms/ios/mixer.d.ts +9 -0
  131. package/lib/typescript/view/MixView.d.ts +52 -0
  132. package/lib/typescript/view/VeImageView.d.ts +19 -0
  133. package/lib/typescript/view/VeTextView.d.ts +7 -0
  134. package/lib/typescript/view/VeView.d.ts +7 -0
  135. package/lib/typescript/view/VeWebView.d.ts +7 -0
  136. package/lib/typescript/view/index.d.ts +5 -0
  137. package/package.json +1 -1
  138. package/react-native-velive-push.podspec +3 -3
  139. package/android/src/main/java/com/volcengine/velive/rn/push/ScreenCaptureHelper.java +0 -73
@@ -1,2 +1,18 @@
1
- import { VeLiveAudioDevice, VeLiveAudioFrame, VeLiveCameraDevice, VeLiveMediaPlayer, VeLiveMixerManager, VeLivePusher as _VeLivePusher, VeLivePusherConfiguration, VeLiveVideoEffectManager, VeLiveVideoFrame } from '../codegen/pack/api';
2
- export { VeLiveAudioDevice, VeLiveAudioFrame, VeLiveCameraDevice, VeLiveMediaPlayer, VeLiveMixerManager, VeLivePusherConfiguration, VeLiveVideoEffectManager, VeLiveVideoFrame, _VeLivePusher as VeLivePusher, };
1
+ import { VeLiveAudioDevice, VeLiveCameraDevice, VeLiveMediaPlayer, VeLivePusher as _VeLivePusher, VeLivePusherConfiguration, VeLiveVideoEffectManager } from '../codegen/pack/api';
2
+ import { VeLiveAudioFrame, VeLiveVideoFrame } from '../codegen/pack/keytype';
3
+ import { VeLiveMixerManager } from './mixer';
4
+ declare module '../codegen/pack/api' {
5
+ interface VeLivePusher {
6
+ /** {zh}
7
+ * @detail api
8
+ * @brief 获取混流管理对象。
9
+ * @return <br>
10
+ * 混流管理对象 VeLiveMixerManager{@link #VeLiveMixerManager}。
11
+ * @order 51
12
+ *
13
+ */
14
+
15
+ getMixerManager(): VeLiveMixerManager;
16
+ }
17
+ }
18
+ export { VeLiveAudioDevice, VeLiveAudioFrame, VeLiveCameraDevice, VeLiveMediaPlayer, VeLivePusherConfiguration, VeLiveVideoEffectManager, VeLiveVideoFrame, _VeLivePusher as VeLivePusher, };
@@ -1,2 +1,18 @@
1
1
  import { VeLiveAudioBufferType, VeLiveAudioCaptureConfiguration, VeLiveAudioCaptureType, VeLiveAudioChannel, VeLiveAudioEncoderConfiguration, VeLiveAudioFrameSource, VeLiveAudioMixType, VeLiveAudioPowerLevel, VeLiveAudioProfile, VeLiveAudioSampleRate, VeLiveFileRecorderConfiguration, VeLiveFirstFrameType, VeLiveMixAudioLayout, VeLiveMixVideoLayout, VeLiveNetworkQuality, VeLivePixelFormat, VeLivePusherLogLevel, VeLivePusherRenderMode, VeLivePusherStatistics, VeLivePusherStatus, VeLiveStreamMixDescription, VeLiveVideoBufferType, VeLiveVideoCaptureConfiguration, VeLiveVideoCaptureType, VeLiveVideoCodec, VeLiveVideoEffectLicenseConfiguration, VeLiveVideoEffectLicenseType, VeLiveVideoEncoderConfiguration, VeLiveVideoFrameSource, VeLiveVideoMirrorType, VeLiveVideoResolution, VeLiveVideoRotation, VeLiveOrientation } from '../codegen/pack/keytype';
2
+ export interface MixConfig {
3
+ x: number;
4
+ y: number;
5
+ width: number;
6
+ height: number;
7
+ alpha?: number;
8
+ zOrder?: number;
9
+ renderMode?: number;
10
+ captureMode?: 'onchange' | 'realtime' | 'auto' | 'manual';
11
+ }
12
+ export interface MixViewConfig {
13
+ renderMode?: number;
14
+ captureMode?: 'onchange' | 'realtime' | 'auto' | 'manual';
15
+ captureFramerate?: number;
16
+ autoSensitivity?: number;
17
+ }
2
18
  export { VeLiveOrientation, VeLiveAudioBufferType, VeLiveAudioCaptureConfiguration, VeLiveAudioCaptureType, VeLiveAudioChannel, VeLiveAudioEncoderConfiguration, VeLiveAudioFrameSource, VeLiveAudioMixType, VeLiveAudioPowerLevel, VeLiveAudioProfile, VeLiveAudioSampleRate, VeLiveFileRecorderConfiguration, VeLiveFirstFrameType, VeLiveMixAudioLayout, VeLiveMixVideoLayout, VeLiveNetworkQuality, VeLivePixelFormat, VeLivePusherLogLevel, VeLivePusherRenderMode, VeLivePusherStatistics, VeLivePusherStatus, VeLiveStreamMixDescription, VeLiveVideoBufferType, VeLiveVideoCaptureConfiguration, VeLiveVideoCaptureType, VeLiveVideoCodec, VeLiveVideoEffectLicenseConfiguration, VeLiveVideoEffectLicenseType, VeLiveVideoEncoderConfiguration, VeLiveVideoFrameSource, VeLiveVideoMirrorType, VeLiveVideoResolution, VeLiveVideoRotation, };
@@ -0,0 +1,26 @@
1
+ import type { VeLivePusher } from './api';
2
+ import { VeLiveMixerManager as AndroidVeLiveMixerManager } from '../platforms/android/mixer';
3
+ import { VeLiveMixerManager as iOSVeLiveMixerManager } from '../platforms/ios/mixer';
4
+ import type { MixConfig } from './keytype';
5
+ export declare class VeLiveMixerManager {
6
+ private _pusher;
7
+ private _views;
8
+ protected _instance: AndroidVeLiveMixerManager | iOSVeLiveMixerManager;
9
+ protected __init(): void;
10
+ protected __new_instance(): AndroidVeLiveMixerManager | iOSVeLiveMixerManager;
11
+ constructor(pusher: VeLivePusher);
12
+ /**
13
+ * Add view to mixer - support hybrid-runtime way
14
+ * @param viewId viewId string
15
+ * @param config mixer configuration
16
+ */
17
+ addView(viewId: string, config: MixConfig): Promise<boolean>;
18
+ /**
19
+ * Update view configuration
20
+ */
21
+ updateView(viewId: string, config: Partial<MixConfig>): Promise<boolean>;
22
+ /**
23
+ * Remove view
24
+ */
25
+ removeView(viewId: string): Promise<boolean>;
26
+ }
@@ -11,6 +11,3 @@ export interface InitOptions extends Partial<VeLivePusherConfiguration> {
11
11
  }
12
12
  export declare function initPusher(options: InitOptions): Promise<VeLivePusher>;
13
13
  export declare function relaunchPusher(options: InitOptions): Promise<VeLivePusher>;
14
- export declare function startScreenCapture(pusher: VeLivePusher, options: {
15
- enableAppAudio: boolean;
16
- }): Promise<boolean>;
@@ -1,2 +1,3 @@
1
1
  export * from './component';
2
2
  export * from './core';
3
+ export * from './view';
@@ -0,0 +1,8 @@
1
+ import { NativeView } from '@vcloud-lux/hybrid-runtime';
2
+ export declare class SurfaceHolder {
3
+ }
4
+ export declare class NativeSurfaceView extends NativeView {
5
+ getHolder(): Promise<SurfaceHolder>;
6
+ }
7
+ export declare class AndroidView extends NativeView {
8
+ }
@@ -0,0 +1,8 @@
1
+ import type { VeLivePusher } from '../../codegen/android';
2
+ import type { MixViewConfig } from '../../core/keytype';
3
+ export declare class VeLiveMixerManager {
4
+ setPusher(pusher: VeLivePusher): void;
5
+ addView(viewId: string, config: MixViewConfig): Promise<boolean>;
6
+ updateView(viewId: string, config: MixViewConfig): Promise<boolean>;
7
+ removeView(viewId: string): Promise<boolean>;
8
+ }
@@ -0,0 +1,9 @@
1
+ import type { VeLivePusher } from '../../codegen/ios';
2
+ import type { MixViewConfig } from '../../core/keytype';
3
+ export declare class VeLiveMixerManager {
4
+ setPusher(pusher: VeLivePusher): void;
5
+ addView(viewId: string, config: MixViewConfig): Promise<number>;
6
+ updateView(viewId: string, config: MixViewConfig): Promise<boolean>;
7
+ removeView(viewId: string): Promise<boolean>;
8
+ captureView(viewId: string): Promise<void>;
9
+ }
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { type ViewProps } from 'react-native';
3
+ import type { MixViewConfig } from '../core/keytype';
4
+ export interface NativeMixViewProps extends ViewProps, Partial<MixViewConfig> {
5
+ children?: React.ReactNode;
6
+ /**
7
+ * Capture mode determines when to capture bitmap for mixing:
8
+ *
9
+ * - 'onchange': Capture only when view layout/content changes (DEFAULT)
10
+ * Best for: static UI elements, text, static images
11
+ * Performance: Optimal - minimal CPU usage
12
+ *
13
+ * - 'realtime': Capture at streaming framerate (e.g., 30fps)
14
+ * Best for: WebView animations, GIF images, custom animations
15
+ * Performance: Higher CPU usage but smooth animation
16
+ *
17
+ * - 'manual': User controls capture timing via ref methods
18
+ * Best for: Custom scenarios where you want full control
19
+ * Performance: Depends on user implementation
20
+ *
21
+ * - 'auto': Automatically detect based on content behavior (experimental)
22
+ * Monitors view changes and switches between onchange/realtime
23
+ */
24
+ captureMode?: 'onchange' | 'realtime' | 'manual' | 'auto';
25
+ /**
26
+ * For realtime mode: custom framerate (default uses stream framerate)
27
+ */
28
+ captureFramerate?: number;
29
+ /**
30
+ * For auto mode: sensitivity threshold for switching to realtime
31
+ * Higher values = less sensitive to changes
32
+ */
33
+ autoSensitivity?: number;
34
+ }
35
+ export interface MixViewEventProps {
36
+ /**
37
+ * viewId, if not provided, will be generated automatically
38
+ */
39
+ viewId?: string;
40
+ /**
41
+ * onViewMount, called when the view is mounted
42
+ */
43
+ onViewMount?: (viewId: string) => void;
44
+ /**
45
+ * onViewUnmount, called when the view is unmounted
46
+ */
47
+ onViewUnmount?: (viewId: string) => void;
48
+ }
49
+ export interface MixViewProps extends MixViewEventProps, NativeMixViewProps {
50
+ }
51
+ export declare const NativeMixView: import("react-native").HostComponent<MixViewProps>;
52
+ export declare const MixView: React.ForwardRefExoticComponent<MixViewProps & React.RefAttributes<any>>;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { Image, type ImageProps } from 'react-native';
3
+ import type { MixViewConfig } from '../core/keytype';
4
+ import { type MixViewEventProps, type MixViewProps } from './MixView';
5
+ export interface VeImageViewProps extends MixViewEventProps, ImageProps, Partial<MixViewConfig> {
6
+ children?: React.ReactNode;
7
+ /**
8
+ * Whether the image is animated (GIF, WebP, etc.)
9
+ * If true, will automatically use 'realtime' capture mode
10
+ */
11
+ animated?: boolean;
12
+ /**
13
+ * Override capture mode
14
+ * - If not specified and animated=true, uses 'realtime'
15
+ * - If not specified and animated=false/undefined, uses 'onchange'
16
+ */
17
+ captureMode?: MixViewProps['captureMode'];
18
+ }
19
+ export declare const VeImageView: React.ForwardRefExoticComponent<VeImageViewProps & React.RefAttributes<Image>>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { Text, type TextProps } from 'react-native';
3
+ import type { MixViewConfig } from '../core/keytype';
4
+ import { type MixViewEventProps } from './MixView';
5
+ export interface VeTextViewProps extends MixViewEventProps, TextProps, MixViewConfig {
6
+ }
7
+ export declare const VeTextView: React.ForwardRefExoticComponent<VeTextViewProps & React.RefAttributes<Text>>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { View, type ViewProps } from 'react-native';
3
+ import type { MixViewConfig } from '../core/keytype';
4
+ import { type MixViewEventProps } from './MixView';
5
+ export interface VeViewProps extends MixViewEventProps, ViewProps, MixViewConfig {
6
+ }
7
+ export declare const VeView: React.ForwardRefExoticComponent<VeViewProps & React.RefAttributes<View>>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { View, type ViewProps } from 'react-native';
3
+ import type { MixViewConfig } from '../core/keytype';
4
+ import { type MixViewEventProps } from './MixView';
5
+ export interface VeWebViewProps extends MixViewEventProps, ViewProps, MixViewConfig {
6
+ }
7
+ export declare const VeWebView: React.ForwardRefExoticComponent<VeWebViewProps & React.RefAttributes<View>>;
@@ -0,0 +1,5 @@
1
+ export { VeView, type VeViewProps } from './VeView';
2
+ export { VeTextView, type VeTextViewProps } from './VeTextView';
3
+ export { VeImageView, type VeImageViewProps } from './VeImageView';
4
+ export { VeWebView, type VeWebViewProps } from './VeWebView';
5
+ export { MixView, NativeMixView, type MixViewProps } from './MixView';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volcengine/react-native-live-push",
3
- "version": "1.1.3-rc.1",
3
+ "version": "1.2.0-rc.0",
4
4
  "peerDependencies": {
5
5
  "react": "*",
6
6
  "react-native": "*"
@@ -49,7 +49,7 @@ Pod::Spec.new do |s|
49
49
  end
50
50
  end
51
51
 
52
- s.dependency 'VolcApiEngine', '1.2.3'
53
- s.dependency 'TTSDKFramework/Core', '1.41.3.7-premium'
54
- s.dependency 'TTSDKFramework/LivePush-RTS', '1.41.3.7-premium'
52
+ s.dependency 'VolcApiEngine', '1.6.2'
53
+ s.dependency 'TTSDKFramework/Core', '1.46.3.9-premium'
54
+ s.dependency 'TTSDKFramework/LivePush-RTS', '1.46.3.9-premium'
55
55
  end
@@ -1,73 +0,0 @@
1
- package com.volcengine.velive.rn.push;
2
-
3
- import static android.content.Context.MEDIA_PROJECTION_SERVICE;
4
-
5
- import static com.volcengine.VolcApiEngine.runtime.NativeVariableManager.*;
6
-
7
- import android.app.Activity;
8
- import android.content.Intent;
9
- import android.media.projection.MediaProjectionManager;
10
-
11
- import androidx.annotation.NonNull;
12
- import androidx.annotation.Nullable;
13
- import androidx.appcompat.app.AppCompatActivity;
14
-
15
- import com.facebook.react.bridge.ActivityEventListener;
16
- import com.facebook.react.bridge.ReactApplicationContext;
17
-
18
- public class ScreenCaptureHelper {
19
- static final int SCREEN_RECORD_REQUEST_CODE = 1010;
20
-
21
- private final ReactApplicationContext reactApplicationContext;
22
-
23
- private AsyncVariableGetterCallback<Intent> mCallback;
24
-
25
- ScreenCaptureHelper(ReactApplicationContext reactApplicationContext) {
26
- this.reactApplicationContext = reactApplicationContext;
27
- }
28
-
29
- ReactApplicationContext getReactApplicationContext() {
30
- return this.reactApplicationContext;
31
- }
32
-
33
- public void setup() {
34
- getReactApplicationContext().addActivityEventListener(new ActivityEventListener() {
35
- @Override
36
- public void onActivityResult(Activity activity, int requestCode, int resultCode, @Nullable Intent intent) {
37
- if (requestCode != SCREEN_RECORD_REQUEST_CODE) {
38
- return;
39
- }
40
-
41
- // success
42
- if (resultCode == AppCompatActivity.RESULT_OK) {
43
- if (mCallback != null) {
44
- mCallback.resolve(null, intent);
45
- mCallback = null;
46
- }
47
- return;
48
- }
49
-
50
- // error
51
- if (mCallback != null) {
52
- mCallback.resolve(new Exception("permission error"), null);
53
- mCallback = null;
54
- }
55
- }
56
-
57
- @Override
58
- public void onNewIntent(Intent intent) {
59
- }
60
- });
61
- }
62
-
63
- public void getScreenIntent(Object[] args, @NonNull AsyncVariableGetterCallback cb) {
64
- this.mCallback = cb;
65
- this.requestPermission();
66
- }
67
-
68
- private void requestPermission() {
69
- MediaProjectionManager mediaProjectionManager = (MediaProjectionManager) getReactApplicationContext().getSystemService(MEDIA_PROJECTION_SERVICE);
70
- Intent permissionIntent = mediaProjectionManager.createScreenCaptureIntent();
71
- getReactApplicationContext().getCurrentActivity().startActivityForResult(permissionIntent, SCREEN_RECORD_REQUEST_CODE);
72
- }
73
- }