@volcengine/react-native-live-pull 1.0.2 → 1.1.1-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 (54) hide show
  1. package/README.md +1 -0
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/AndroidManifest.xml +7 -1
  4. package/android/src/main/AndroidManifestNew.xml +15 -1
  5. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcLiveModule.java +29 -21
  6. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcView.java +7 -8
  7. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcViewManager.java +1 -1
  8. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/FloatingWindowHelper.java +224 -0
  9. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/FloatingWindowService.java +171 -0
  10. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/IFloatingWindowHelper.java +80 -0
  11. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/PictureInPictureManager.java +280 -0
  12. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/VeLiveRefManager.java +119 -0
  13. package/android/src/main/res/drawable/button_close.xml +14 -0
  14. package/android/src/main/res/layout/floating_window_layout.xml +19 -0
  15. package/ios/VeLivePlayerMultiObserver.h +54 -0
  16. package/ios/VeLivePlayerMultiObserver.m +324 -0
  17. package/ios/VeLivePullView.m +1 -1
  18. package/ios/VeLivePullViewManager.m +1 -1
  19. package/ios/pictureInpicture/PictureInPictureManager.h +29 -0
  20. package/ios/pictureInpicture/PictureInPictureManager.m +274 -0
  21. package/ios/pictureInpicture/VeLivePictureInPictureController.h +207 -0
  22. package/ios/pictureInpicture/VeLivePictureInPictureController.m +3393 -0
  23. package/lib/commonjs/index.js +12343 -7761
  24. package/lib/module/index.js +12344 -7760
  25. package/lib/typescript/codegen/android/api.d.ts +76 -22
  26. package/lib/typescript/codegen/android/callback.d.ts +21 -4
  27. package/lib/typescript/codegen/android/errorcode.d.ts +25 -2
  28. package/lib/typescript/codegen/android/external.d.ts +1 -0
  29. package/lib/typescript/codegen/android/index.d.ts +1 -0
  30. package/lib/typescript/codegen/android/keytype.d.ts +119 -15
  31. package/lib/typescript/codegen/android/types.d.ts +7 -6
  32. package/lib/typescript/codegen/ios/api.d.ts +13 -27
  33. package/lib/typescript/codegen/ios/callback.d.ts +19 -33
  34. package/lib/typescript/codegen/ios/external.d.ts +1 -0
  35. package/lib/typescript/codegen/ios/index.d.ts +1 -0
  36. package/lib/typescript/codegen/ios/keytype.d.ts +0 -56
  37. package/lib/typescript/codegen/ios/types.d.ts +16 -5
  38. package/lib/typescript/codegen/pack/api.d.ts +93 -117
  39. package/lib/typescript/codegen/pack/callback.d.ts +73 -56
  40. package/lib/typescript/codegen/pack/errorcode.d.ts +65 -45
  41. package/lib/typescript/codegen/pack/external.d.ts +1 -0
  42. package/lib/typescript/codegen/pack/index.d.ts +2 -1
  43. package/lib/typescript/codegen/pack/keytype.d.ts +501 -544
  44. package/lib/typescript/codegen/pack/types.d.ts +68 -1
  45. package/lib/typescript/component.d.ts +9 -2
  46. package/lib/typescript/core/api.d.ts +88 -1
  47. package/lib/typescript/core/callback.d.ts +52 -0
  48. package/lib/typescript/core/keytype.d.ts +1 -1
  49. package/lib/typescript/platforms/android/extends.d.ts +1 -1
  50. package/lib/typescript/platforms/android/pictureInpicture.d.ts +26 -0
  51. package/lib/typescript/platforms/ios/extends.d.ts +2 -0
  52. package/lib/typescript/platforms/ios/pictureInpicture.d.ts +32 -0
  53. package/package.json +6 -4
  54. package/react-native-velive-pull.podspec +1 -1
@@ -1 +1,68 @@
1
- export type View = any;
1
+ export type int = number;
2
+ export type Context = unknown;
3
+ export type JSONObject = any;
4
+ export type id<T = any> = T;
5
+ export type BOOL = boolean;
6
+ export type bool = boolean;
7
+ export type long = number;
8
+ export type float = number;
9
+ export type int64_t = number;
10
+ export type double = number;
11
+ export type dispatch_queue_t = any;
12
+ export type NSString = string;
13
+ export type NSMutableString = string;
14
+ export type NSInteger = number;
15
+ export type NSUInteger = number;
16
+ export type NSNumber = number;
17
+ export type NSValue = number;
18
+ export type NSNull = null;
19
+ export type NSArray<T = any> = Array<T>;
20
+ export type NSMutableArray<T = any> = Array<T>;
21
+ export type NSObject<T = any> = T;
22
+ export type NSDictionary<K extends keyof any = any, V = any> = {
23
+ [P in K]: V;
24
+ };
25
+ export type NSMutableDictionary = Object;
26
+ export type NSDate = Date;
27
+ export type NSData = ArrayBuffer;
28
+ export type NSURL = string;
29
+ export type NSError = {
30
+ code: number;
31
+ domain: string;
32
+ };
33
+ export type NSTimeInterval = number;
34
+ export type UIImage = unknown;
35
+ export type CVPixelBufferRef = any;
36
+ export type CMSampleBufferRef = any;
37
+ export type CMTime = number;
38
+ export type GLuint = number;
39
+ export type CGFloat = number;
40
+ export type SInt64 = number;
41
+ export type intptr_t = any;
42
+ export type uint32_t = number;
43
+ export type uint8_t = number;
44
+ export type longlong = number;
45
+ export type String = string;
46
+ export type Boolean = boolean;
47
+ export type Void = void;
48
+ export type Integer = number;
49
+ export type Double = number;
50
+ export type List<T = any> = Array<T>;
51
+ export type list<T = any> = Array<T>;
52
+ export type ArrayList<T = any> = Array<T>;
53
+ export type Map<K extends keyof any = any, V = any> = Record<K, V>;
54
+ export type HashMap<K extends keyof any = any, V = any> = Record<K, V>;
55
+ export type Pair<K extends keyof any = any, V = any> = Record<K, V>;
56
+ export type set<T = any> = Set<T>;
57
+ export type map = Object;
58
+ export type struct = Object;
59
+ export type Bitmap = unknown;
60
+ export type EGLContext = unknown;
61
+ export type ByteArray = number;
62
+ export type ByteBuffer = ArrayBuffer;
63
+ export type Matrix = unknown;
64
+ export type SurfaceHolder = unknown;
65
+ export type Surface = unknown;
66
+ export type Runnable = unknown;
67
+ export type View = unknown;
68
+ export type Intent = unknown;
@@ -1,8 +1,15 @@
1
- export type NativeSurfaceViewComponentProps = {
1
+ import React from 'react';
2
+ type VolcViewProps = {
2
3
  viewId: string;
3
4
  kind: 'SurfaceView' | 'UIView';
4
5
  children?: any;
5
6
  style?: any;
7
+ onViewLoad?: () => void;
8
+ };
9
+ export type NativeSurfaceViewComponentProps = Omit<VolcViewProps, 'onViewLoad'> & {
6
10
  onLoad?: () => void;
7
11
  };
8
- export declare const NativeViewComponent: import("react-native").HostComponent<NativeSurfaceViewComponentProps>;
12
+ export declare class NativeViewComponent extends React.Component<NativeSurfaceViewComponentProps> {
13
+ render(): React.ReactNode;
14
+ }
15
+ export {};
@@ -1 +1,88 @@
1
- export { VeLivePlayer } from '../codegen/pack/api';
1
+ import { VeLivePlayer } from '../codegen/pack/api';
2
+ import type { VeLivePlayerObserver, PictureInPictureManagerListener } from './callback';
3
+ export { VeLivePlayerObserver };
4
+ declare module '../codegen/pack/api' {
5
+ interface VeLivePlayer {
6
+ /**
7
+ * {zh}
8
+ * @brief 开始悬浮窗
9
+ * @param aspectRatio 悬浮窗宽高比
10
+ * @param x 悬浮窗x坐标
11
+ * @param y 悬浮窗y坐标
12
+ * @order 1
13
+ */
14
+ /**
15
+ * {en}
16
+ * @brief Start picture in picture
17
+ * @param aspectRatio floating window aspect ratio
18
+ * @param x floating window x coordinate
19
+ * @param y floating window y coordinate
20
+ * @order 1
21
+ */
22
+ startPictureInPicture(aspectRatio?: number, x?: number, y?: number): Promise<void>;
23
+ /**
24
+ * {zh}
25
+ * @brief 结束悬浮窗
26
+ * @order 2
27
+ */
28
+ /**
29
+ * {en}
30
+ * @brief Stop picture in picture
31
+ * @order 2
32
+ */
33
+ stopPictureInPicture(): Promise<void>;
34
+ /**
35
+ * {zh}
36
+ * @brief 判断是否支持画中画
37
+ * @return 是否支持画中画
38
+ * @order 3
39
+ */
40
+ /**
41
+ * {en}
42
+ * @brief Check if picture in picture is supported
43
+ * @return Whether picture in picture is supported
44
+ * @order 3
45
+ */
46
+ isPictureInPictureSupported(): boolean;
47
+ /**
48
+ * {zh}
49
+ * @brief 设置画中画监听器
50
+ * @param listener 画中画监听器
51
+ * @order 4
52
+ */
53
+ /**
54
+ * {en}
55
+ * @brief Set picture in picture listener
56
+ * @param listener picture in picture listener
57
+ * @order 4
58
+ */
59
+ setPictureInPictureListener(listener: PictureInPictureManagerListener): void;
60
+ /**
61
+ * {zh}
62
+ * @brief 启用画中画,当切出app后,会自动启动画中画
63
+ * @platform ios only
64
+ * @order 5
65
+ */
66
+ /**
67
+ * {en}
68
+ * @brief Enable picture in picture, when the app is switched out, the picture in picture will be automatically started
69
+ * @platform ios only
70
+ * @order 5
71
+ */
72
+ enablePictureInPicture(): Promise<void>;
73
+ /**
74
+ * {zh}
75
+ * @brief 禁用画中画
76
+ * @platform ios only
77
+ * @order 6
78
+ */
79
+ /**
80
+ * {en}
81
+ * @brief Disable picture in picture, when the app is switched out, the picture in picture does not automatically start
82
+ * @platform ios only
83
+ * @order 6
84
+ */
85
+ disablePictureInPicture(): Promise<void>;
86
+ }
87
+ }
88
+ export { VeLivePlayer };
@@ -1 +1,53 @@
1
1
  export type { VeLivePlayerObserver } from '../codegen/pack/callback';
2
+ /**
3
+ * {zh}
4
+ * @brief 悬浮窗管理器回调
5
+ * @order 1
6
+ */
7
+ /**
8
+ * {en}
9
+ * @brief Picture in picture manager callback
10
+ * @order 1
11
+ */
12
+ export interface PictureInPictureManagerListener {
13
+ /**
14
+ * {zh}
15
+ * @brief 悬浮窗开始回调
16
+ */
17
+ /**
18
+ * {en}
19
+ * @brief Picture in picture start callback
20
+ */
21
+ onStartPictureInPicture?(): void;
22
+ /**
23
+ * {zh}
24
+ * @brief 悬浮窗结束回调
25
+ */
26
+ /**
27
+ * {en}
28
+ * @brief Picture in picture stop callback
29
+ */
30
+ onStopPictureInPicture?(): void;
31
+ /**
32
+ * {zh}
33
+ * @brief 悬浮窗点击回调
34
+ */
35
+ /**
36
+ * {en}
37
+ * @brief Picture in picture click callback
38
+ */
39
+ onClickPictureInPicture?(): void;
40
+ /**
41
+ * {zh}
42
+ * @brief 悬浮窗错误回调
43
+ * @param code 错误码 0: 成功, 1: 不支持, 2: 参数错误, 3: 已开启
44
+ * @param extraData 额外数据
45
+ */
46
+ /**
47
+ * {en}
48
+ * @brief Picture in picture error callback
49
+ * @param code error code 0: success, 1: not supported, 2: invalid params, 3: already opened
50
+ * @param extraData extra data
51
+ */
52
+ onError?(code: number, extraData: any): void;
53
+ }
@@ -1 +1 @@
1
- export { VeLivePlayerAudioBufferType, VeLivePlayerAudioFrame, VeLivePlayerBMFFlexSRErrorCode, VeLivePlayerBMFFlexSRType, VeLivePlayerConfiguration, VeLivePlayerFillMode, VeLivePlayerFormat, VeLivePlayerLogConfig, VeLivePlayerLogLevel, VeLivePlayerMirror, VeLivePlayerPixelFormat, VeLivePlayerProtocol, VeLivePlayerResolution, VeLivePlayerResolutionSwitchReason, VeLivePlayerRotation, VeLivePlayerStatistics, VeLivePlayerStatus, VeLivePlayerStream, VeLivePlayerStreamData, VeLivePlayerStreamType, VeLivePlayerVideoBufferType, VeLivePlayerVideoFrame, VeLivePlayerVideoTexture, } from '../codegen/pack/keytype';
1
+ export { VeLivePlayerAudioBufferType, VeLivePlayerAudioFrame, VeLivePlayerConfiguration, VeLivePlayerFillMode, VeLivePlayerFormat, VeLivePlayerLogLevel, VeLivePlayerMirror, VeLivePlayerPixelFormat, VeLivePlayerProtocol, VeLivePlayerResolution, VeLivePlayerResolutionSwitchReason, VeLivePlayerRotation, VeLivePlayerStatistics, VeLivePlayerStatus, VeLivePlayerStream, VeLivePlayerStreamData, VeLivePlayerStreamType, VeLivePlayerVideoBufferType, VeLivePlayerVideoFrame, } from '../codegen/pack/keytype';
@@ -1,4 +1,4 @@
1
- import { NativeProxyService, NativeView } from '../../runtime';
1
+ import { NativeProxyService, NativeView } from '@vcloud-lux/hybrid-runtime';
2
2
  export declare class SurfaceHolder {
3
3
  }
4
4
  export declare class NativeSurfaceView extends NativeView {
@@ -0,0 +1,26 @@
1
+ import { NativeProxyService } from '@vcloud-lux/hybrid-runtime';
2
+ import type { ApplicationContext, NativeSurfaceView } from './extends';
3
+ import * as $p_a from '../../codegen/android';
4
+ export declare class PictureInPictureManagerListener {
5
+ onStartPictureInPicture?(): void;
6
+ onStopPictureInPicture?(): void;
7
+ onClickPictureInPicture?(): void;
8
+ onError?(code: number, extraData: any): void;
9
+ }
10
+ export declare class android_PictureInPictureListener extends PictureInPictureManagerListener {
11
+ protected _instance: PictureInPictureManagerListener;
12
+ constructor(_instance: PictureInPictureManagerListener);
13
+ onStartPictureInPicture?(): void;
14
+ onStopPictureInPicture?(): void;
15
+ onClickPictureInPicture?(): void;
16
+ onError?(code: number, extraData: any): void;
17
+ }
18
+ export declare class PictureInPictureManager extends NativeProxyService {
19
+ static getInstance(): PictureInPictureManager;
20
+ isPictureInPictureSupported(): boolean;
21
+ setupConfig(aspectRatio: number, x: number, y: number): void;
22
+ setListener(listener: PictureInPictureManagerListener): void;
23
+ startPictureInPicture(aspectRatio?: number, x?: number, y?: number): Promise<void>;
24
+ stopPictureInPicture(): Promise<void>;
25
+ setupPlayer(player: $p_a.VeLivePlayer, context: ApplicationContext, surfaceView: NativeSurfaceView): void;
26
+ }
@@ -39,3 +39,5 @@ export interface VeLivePlayerObserverEvents {
39
39
  export declare enum TTSDKServiceVendor {
40
40
  TTSDKServiceVendorCN = 1
41
41
  }
42
+ export declare class UIView extends NativeUIView {
43
+ }
@@ -0,0 +1,32 @@
1
+ import type { TVLManager, VeLivePlayerObserver } from '../../codegen/ios';
2
+ export declare class VeLivePictureInPictureManager {
3
+ static getInstance(): VeLivePictureInPictureManager;
4
+ isPictureInPictureSupported(): boolean;
5
+ setupPlayer(player: TVLManager): Promise<void>;
6
+ startPictureInPicture(): Promise<void>;
7
+ stopPictureInPicture(): Promise<void>;
8
+ enablePictureInPicture(): Promise<void>;
9
+ disablePictureInPicture(): Promise<void>;
10
+ destroyPictureInPicture(): Promise<void>;
11
+ setListener(listener: VeLivePictureInPictureManagerListener): Promise<void>;
12
+ }
13
+ export declare class VeLivePlayerMultiObserver {
14
+ static getInstance(): VeLivePlayerMultiObserver;
15
+ setupPlayer(player: TVLManager): Promise<void>;
16
+ addObserver(observerId: string, observer: VeLivePlayerObserver): Promise<void>;
17
+ removeObserver(observerId: string): Promise<void>;
18
+ }
19
+ export declare class VeLivePictureInPictureManagerListener {
20
+ onStartPictureInPicture?(): void;
21
+ onStopPictureInPicture?(): void;
22
+ onClickPictureInPicture?(): void;
23
+ onError$code$extraData?(code: number, extraData: any): void;
24
+ }
25
+ export declare class ios_PictureInPictureManagerListener extends VeLivePictureInPictureManagerListener {
26
+ protected _instance: VeLivePictureInPictureManagerListener;
27
+ constructor(_instance: VeLivePictureInPictureManagerListener);
28
+ onStartPictureInPicture?(): void;
29
+ onStopPictureInPicture?(): void;
30
+ onClickPictureInPicture?(): void;
31
+ onError$code$extraData?(code: number, extraData: any): void;
32
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volcengine/react-native-live-pull",
3
- "version": "1.0.2",
3
+ "version": "1.1.1-rc.0",
4
4
  "peerDependencies": {
5
5
  "react": "*",
6
6
  "react-native": "*"
@@ -8,7 +8,6 @@
8
8
  "main": "lib/commonjs/index.js",
9
9
  "module": "lib/module/index.js",
10
10
  "types": "lib/typescript/index.d.ts",
11
- "license": "MIT",
12
11
  "files": [
13
12
  "android",
14
13
  "ios",
@@ -27,6 +26,9 @@
27
26
  "!**/*.xcframework"
28
27
  ],
29
28
  "author": "vcloud-fe",
30
- "description": "volcengine velive player sdk for react native",
31
- "homepage": "https://www.volcengine.com"
29
+ "description": "VolcEngine sdk for react native",
30
+ "homepage": "https://www.volcengine.com",
31
+ "devDependencies": {
32
+ "zx": "^8.1.1"
33
+ }
32
34
  }
@@ -39,7 +39,7 @@ Pod::Spec.new do |s|
39
39
  end
40
40
  end
41
41
 
42
- s.dependency 'VolcApiEngine', '1.0.1'
42
+ s.dependency 'VolcApiEngine', '1.2.3'
43
43
  s.dependency 'TTSDKFramework/Core', '1.41.3.7-premium'
44
44
  s.dependency 'TTSDKFramework/LivePull-RTS', '1.41.3.7-premium'
45
45
  end