@volcengine/react-native-live-pull 1.0.3-rc.0 → 1.1.1

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 (28) hide show
  1. package/android/src/main/AndroidManifest.xml +7 -1
  2. package/android/src/main/AndroidManifestNew.xml +15 -1
  3. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcLiveModule.java +28 -20
  4. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcView.java +7 -8
  5. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/FloatingWindowHelper.java +225 -0
  6. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/FloatingWindowService.java +253 -0
  7. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/IFloatingWindowHelper.java +80 -0
  8. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/PictureInPictureManager.java +257 -0
  9. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/VeLiveRefManager.java +119 -0
  10. package/android/src/main/res/drawable/button_close.xml +9 -0
  11. package/android/src/main/res/drawable/new_window.xml +16 -0
  12. package/android/src/main/res/layout/floating_window_layout.xml +29 -0
  13. package/ios/VeLivePlayerMultiObserver.h +54 -0
  14. package/ios/VeLivePlayerMultiObserver.m +324 -0
  15. package/ios/pictureInpicture/PictureInPictureManager.h +29 -0
  16. package/ios/pictureInpicture/PictureInPictureManager.m +274 -0
  17. package/ios/pictureInpicture/VeLivePictureInPictureController.h +207 -0
  18. package/ios/pictureInpicture/VeLivePictureInPictureController.m +3393 -0
  19. package/lib/commonjs/index.js +1981 -5044
  20. package/lib/module/index.js +1981 -5044
  21. package/lib/typescript/codegen/pack/errorcode.d.ts +27 -27
  22. package/lib/typescript/codegen/pack/types.d.ts +1 -1
  23. package/lib/typescript/core/api.d.ts +88 -1
  24. package/lib/typescript/core/callback.d.ts +52 -0
  25. package/lib/typescript/platforms/android/extends.d.ts +1 -1
  26. package/lib/typescript/platforms/android/pictureInpicture.d.ts +26 -0
  27. package/lib/typescript/platforms/ios/pictureInpicture.d.ts +32 -0
  28. package/package.json +1 -1
@@ -17,131 +17,131 @@ export declare enum VeLivePlayerErrorCode {
17
17
  *
18
18
  */
19
19
 
20
- VeLivePlayerInvalidLicense = 1,
20
+ VeLivePlayerInvalidLicense = -1,
21
21
  /** {zh}
22
22
  * @brief 调用时传入的参数不合法。请检查入参,并重新调用。
23
23
  *
24
24
  */
25
25
 
26
- VeLivePlayerInvalidParameter = 2,
26
+ VeLivePlayerInvalidParameter = -2,
27
27
  /** {zh}
28
28
  * @brief 调用被拒绝。方法调用时机不合法,请检查调用时机。
29
29
  *
30
30
  */
31
31
 
32
- VeLivePlayerErrorRefused = 3,
32
+ VeLivePlayerErrorRefused = -3,
33
33
  /** {zh}
34
34
  * @brief 加载库文件失败。可能是 SDK 集成错误,请检查 SDK 集成方式。
35
35
  *
36
36
  */
37
37
 
38
- VeLivePlayerErrorLibraryLoadFailed = 4,
38
+ VeLivePlayerErrorLibraryLoadFailed = -4,
39
39
  /** {zh}
40
40
  * @brief 播放地址不存在或无效。可能是播放地址为空、地址格式不合法或地址长度不合法,请检查播放地址。
41
41
  *
42
42
  */
43
43
 
44
- VeLivePlayerErrorPlayUrl = 5,
44
+ VeLivePlayerErrorPlayUrl = -100,
45
45
  /** {zh}
46
46
  * @brief 无法获取流数据。可能是直播流不存在、直播流中断或直播已结束,请检查直播状态。
47
47
  *
48
48
  */
49
49
 
50
- VeLivePlayerErrorNoStreamData = 6,
50
+ VeLivePlayerErrorNoStreamData = -101,
51
51
  /** {zh}
52
52
  * @brief 内部播放重试。可能由于播放器内部错误触发了重试。
53
53
  *
54
54
  */
55
55
 
56
- VeLivePlayerErrorInternalRetryStart = 7,
56
+ VeLivePlayerErrorInternalRetryStart = -102,
57
57
  /** {zh}
58
58
  * @brief 内部重试失败。内部重试次数达到最大限制,播放器停止重试,您可以尝试重新播放。
59
59
  *
60
60
  */
61
61
 
62
- VeLivePlayerErrorInternalRetryFailed = 8,
62
+ VeLivePlayerErrorInternalRetryFailed = -103,
63
63
  /** {zh}
64
64
  * @brief DNS 解析失败。可能是播放地址异常或客户端网络异常,请您检查播放地址和网络情况,如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
65
65
  *
66
66
  */
67
67
 
68
- VeLivePlayerErrorDnsParseFailed = 9,
68
+ VeLivePlayerErrorDnsParseFailed = -200,
69
69
  /** {zh}
70
70
  * @brief 网络请求失败。请检查网络情况,如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
71
71
  *
72
72
  */
73
73
 
74
- VeLivePlayerErrorNetworkRequestFailed = 10,
74
+ VeLivePlayerErrorNetworkRequestFailed = -201,
75
75
  /** {zh}
76
76
  * @brief 直播格式解封装失败。可能是使用了不支持的直播流格式和协议,或音视频流错误;请检查流格式,如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
77
77
  *
78
78
  */
79
79
 
80
- VeLivePlayerErrorDemuxFailed = 11,
80
+ VeLivePlayerErrorDemuxFailed = -300,
81
81
  /** {zh}
82
82
  * @brief 视频解码失败。可能使用了不支持的直播流音视频格式,或解码器出错;请检查音视频格式,如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
83
83
  *
84
84
  */
85
85
 
86
- VeLivePlayerErrorDecodeFailed = 12,
86
+ VeLivePlayerErrorDecodeFailed = -301,
87
87
  /** {zh}
88
88
  * @brief 渲染失败。可能是音视频输出设备异常,请重试;如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
89
89
  *
90
90
  */
91
91
 
92
- VeLivePlayerErrorAVOutputFailed = 13,
92
+ VeLivePlayerErrorAVOutputFailed = -302,
93
93
  /** {zh}
94
94
  * @brief 该台设备不支持超分能力,不在超分机型白名单内;如果有疑问,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
95
95
  *
96
96
  */
97
97
 
98
- VeLivePlayerErrorSRDeviceUnsupported = 14,
98
+ VeLivePlayerErrorSRDeviceUnsupported = -303,
99
99
  /** {zh}
100
100
  * @brief 当前分辨率高于超分开启限制的最大分辨率。如果有疑问,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
101
101
  *
102
102
  */
103
103
 
104
- VeLivePlayerErrorSRResolutionUnsupported = 15,
104
+ VeLivePlayerErrorSRResolutionUnsupported = -304,
105
105
  /** {zh}
106
106
  * @brief 当前帧率高于超分开启限制的最大帧率。如果有疑问,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
107
107
  *
108
108
  */
109
109
 
110
- VeLivePlayerErrorSRFpsUnsupported = 16,
110
+ VeLivePlayerErrorSRFpsUnsupported = -305,
111
111
  /** {zh}
112
112
  * @brief 超分初始化失败。可能超分参数配置错误,或版本不兼容;如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
113
113
  *
114
114
  */
115
115
 
116
- VeLivePlayerErrorSRInitFail = 17,
116
+ VeLivePlayerErrorSRInitFail = -306,
117
117
  /** {zh}
118
118
  * @brief 超分执行失败,可能超分参数配置错误,或版本不兼容;如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
119
119
  *
120
120
  */
121
121
 
122
- VeLivePlayerErrorSRExecuteFail = 18,
122
+ VeLivePlayerErrorSRExecuteFail = -307,
123
123
  /** {zh}
124
124
  * @brief 您使用的基础版 License 暂不支持 H.265 硬件解码,请登录火山引擎[视频直播控制台](https://console.volcengine.com/live/main/sdk)获取高级版 License。
125
125
  *
126
126
  */
127
127
 
128
- VeLivePlayerLicenseUnsupportedH265 = 19,
129
- /** {zh}
130
- * @brief 内部错误。请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
131
- *
132
- */
133
-
134
- VeLivePlayerErrorInternal = 20,
128
+ VeLivePlayerLicenseUnsupportedH265 = -308,
135
129
  /** {zh}
136
130
  * @platform ios
137
131
  * @brief DRM 鉴权失败。
138
132
  */
139
- VeLivePlayerDRMFetchCKCFailed = 21,
133
+ VeLivePlayerDRMFetchCKCFailed = -400,
140
134
  /** {zh}
141
135
  * @platform ios
142
136
  * @brief 服务器播放上下文(SPC)生成失败。
143
137
  */
144
- VeLivePlayerDRMFetchSPCFailed = 22
138
+ VeLivePlayerDRMFetchSPCFailed = -401,
139
+ /** {zh}
140
+ * @brief 内部错误。请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
141
+ *
142
+ */
143
+
144
+ VeLivePlayerErrorInternal = -999
145
145
  }
146
146
  /** {zh}
147
147
  * @detail errorcode
@@ -64,5 +64,5 @@ export type Matrix = unknown;
64
64
  export type SurfaceHolder = unknown;
65
65
  export type Surface = unknown;
66
66
  export type Runnable = unknown;
67
- export type View = unknown;
67
+ export type View = any;
68
68
  export type Intent = unknown;
@@ -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,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
+ }
@@ -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.3-rc.0",
3
+ "version": "1.1.1",
4
4
  "peerDependencies": {
5
5
  "react": "*",
6
6
  "react-native": "*"