@byteplus/react-native-live-pull 1.0.3-rc.1 → 1.1.1-rc.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 +224 -0
  6. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/FloatingWindowService.java +198 -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 +1690 -1955
  20. package/lib/module/index.js +1690 -1955
  21. package/lib/typescript/codegen/pack/errorcode.d.ts +24 -24
  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
@@ -13,125 +13,125 @@ export declare enum VeLivePlayerErrorCode {
13
13
  * @brief The SDK license is invalid. This error may occur due to incorrect integration of the license or if the license has expired. Review how the license was integrated and ensure that it is still valid.
14
14
  *
15
15
  */
16
- VeLivePlayerInvalidLicense = 1,
16
+ VeLivePlayerInvalidLicense = -1,
17
17
 
18
18
  /** {en}
19
19
  * @brief Invalid parameters. Check the input parameter and call the method again.
20
20
  *
21
21
  */
22
- VeLivePlayerInvalidParameter = 2,
22
+ VeLivePlayerInvalidParameter = -2,
23
23
 
24
24
  /** {en}
25
25
  * @brief The method call has been rejected. This error occurs when the method is called at an incorrect time.
26
26
  *
27
27
  */
28
- VeLivePlayerErrorRefused = 3,
28
+ VeLivePlayerErrorRefused = -3,
29
29
 
30
30
  /** {en}
31
31
  * @brief Failed to load the library file. This error may occur due to incorrect integration of the SDK.
32
32
  *
33
33
  */
34
- VeLivePlayerErrorLibraryLoadFailed = 4,
34
+ VeLivePlayerErrorLibraryLoadFailed = -4,
35
35
 
36
36
  /** {en}
37
37
  * @brief The pull stream address does not exist or is invalid. This error may occur if the pull stream address is empty, or if the format or length of the address is invalid.
38
38
  *
39
39
  */
40
- VeLivePlayerErrorPlayUrl = 5,
40
+ VeLivePlayerErrorPlayUrl = -100,
41
41
 
42
42
  /** {en}
43
43
  * @brief Unable to get the stream data. This error may occur if the live stream does not exist, is interrupted, or has ended. Please check the status of the live stream.
44
44
  *
45
45
  */
46
- VeLivePlayerErrorNoStreamData = 6,
46
+ VeLivePlayerErrorNoStreamData = -101,
47
47
 
48
48
  /** {en}
49
49
  * @brief An internal retry to play the live stream, which might happen due to an internal player error.
50
50
  *
51
51
  */
52
- VeLivePlayerErrorInternalRetryStart = 7,
52
+ VeLivePlayerErrorInternalRetryStart = -102,
53
53
 
54
54
  /** {en}
55
55
  * @brief An internal retry failed and the maximum number of internal retries is reached. The player has stopped retrying. You may attempt a manual retry.
56
56
  *
57
57
  */
58
- VeLivePlayerErrorInternalRetryFailed = 8,
58
+ VeLivePlayerErrorInternalRetryFailed = -103,
59
59
 
60
60
  /** {en}
61
61
  * @brief DNS parsing failed. This error may occur due to an error in the pull stream address or the client's network conditions. If the error persists after you verify the pull stream address and network conditions, contact BytePlus technical support for assistance.
62
62
  *
63
63
  */
64
- VeLivePlayerErrorDnsParseFailed = 9,
64
+ VeLivePlayerErrorDnsParseFailed = -200,
65
65
 
66
66
  /** {en}
67
67
  * @brief The network request failed. Check the network conditions. If the error persists, contact BytePlus technical support for assistance.
68
68
  *
69
69
  */
70
- VeLivePlayerErrorNetworkRequestFailed = 10,
70
+ VeLivePlayerErrorNetworkRequestFailed = -201,
71
71
 
72
72
  /** {en}
73
73
  * @brief Video decapsulation failed. This error may occur if the live stream uses an unsupported format or protocol, or if there is an audio or video error. If the error persists, contact BytePlus technical support for assistance.
74
74
  *
75
75
  */
76
- VeLivePlayerErrorDemuxFailed = 11,
76
+ VeLivePlayerErrorDemuxFailed = -300,
77
77
 
78
78
  /** {en}
79
79
  * @brief Decoding failed. This error may occur if the live stream uses an unsupported audio or video format. If the error persists, contact BytePlus technical support for assistance.
80
80
  *
81
81
  */
82
- VeLivePlayerErrorDecodeFailed = 12,
82
+ VeLivePlayerErrorDecodeFailed = -301,
83
83
 
84
84
  /** {en}
85
85
  * @brief Rendering failed. This error may occur if there is an issue with the audio or video output devices. If the error persists, contact BytePlus technical support for assistance.
86
86
  *
87
87
  */
88
- VeLivePlayerErrorAVOutputFailed = 13,
88
+ VeLivePlayerErrorAVOutputFailed = -302,
89
89
 
90
90
  /** {en}
91
91
  * @brief The device model does not support super resolution. Contact BytePlus technical support for any assistance you may need.
92
92
  *
93
93
  */
94
- VeLivePlayerErrorSRDeviceUnsupported = 14,
94
+ VeLivePlayerErrorSRDeviceUnsupported = -303,
95
95
 
96
96
  /** {en}
97
97
  * @brief The current resolution exceeds the upper limit allowed for super resolution. Contact BytePlus technical support for any assistance you may need.
98
98
  *
99
99
  */
100
- VeLivePlayerErrorSRResolutionUnsupported = 15,
100
+ VeLivePlayerErrorSRResolutionUnsupported = -304,
101
101
 
102
102
  /** {en}
103
103
  * @brief The current frame rate exceeds the upper limit allowed for super resolution. Contact BytePlus technical support for any assistance you may need.
104
104
  *
105
105
  */
106
- VeLivePlayerErrorSRFpsUnsupported = 16,
106
+ VeLivePlayerErrorSRFpsUnsupported = -305,
107
107
 
108
108
  /** {en}
109
109
  * @brief Fails to initialize super resolution. Contact BytePlus technical support if the error persists.
110
110
  *
111
111
  */
112
- VeLivePlayerErrorSRInitFail = 17,
112
+ VeLivePlayerErrorSRInitFail = -306,
113
113
 
114
114
  /** {en}
115
115
  * @brief Fails to apply super resolution to the video. Contact BytePlus technical support if the error persists.
116
116
  *
117
117
  */
118
- VeLivePlayerErrorSRExecuteFail = 18,
118
+ VeLivePlayerErrorSRExecuteFail = -307,
119
119
 
120
120
  /** {en}
121
121
  * @brief The current SDK license does not provide support for the H.265 feature.
122
122
  *
123
123
  */
124
- VeLivePlayerLicenseUnsupportedH265 = 19,
124
+ VeLivePlayerLicenseUnsupportedH265 = -308,
125
+
126
+ VeLivePlayerDRMFetchCKCFailed = -400,
127
+
128
+ VeLivePlayerDRMFetchSPCFailed = -401,
125
129
 
126
130
  /** {en}
127
131
  * @brief Internal error. Please contact BytePlus technical support for assistance.
128
132
  *
129
133
  */
130
- VeLivePlayerErrorInternal = 20,
131
-
132
- VeLivePlayerDRMFetchCKCFailed = 21,
133
-
134
- VeLivePlayerDRMFetchSPCFailed = 22
134
+ VeLivePlayerErrorInternal = -999
135
135
  }
136
136
 
137
137
  export declare class VeLivePlayerError {
@@ -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": "@byteplus/react-native-live-pull",
3
- "version": "1.0.3-rc.1",
3
+ "version": "1.1.1-rc.1",
4
4
  "peerDependencies": {
5
5
  "react": "*",
6
6
  "react-native": "*"