@byteplus/react-native-live-pull 1.1.3-rc.3 → 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 (31) hide show
  1. package/android/build.gradle +2 -2
  2. package/android/src/main/java/com/volcengine/velive/rn/pull/ClassHelper.java +15 -0
  3. package/android/src/main/java/com/volcengine/velive/rn/pull/NativeVariableManager.java +1 -1
  4. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcLiveModule.java +2 -0
  5. package/android/src/main/java/com/volcengine/velive/rn/pull/autogen/MethodSignature.java +66 -77
  6. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/FloatingWindowService.java +79 -15
  7. package/ios/VeLivePlayerMultiObserver.h +3 -2
  8. package/ios/VeLivePlayerMultiObserver.m +2 -2
  9. package/ios/include/react-native-velive-pull.modulemap +4 -0
  10. package/ios/pictureInpicture/PictureInPictureManager.h +21 -1
  11. package/ios/pictureInpicture/PictureInPictureManager.m +254 -141
  12. package/lib/commonjs/index.js +4455 -1648
  13. package/lib/module/index.js +4455 -1648
  14. package/lib/typescript/codegen/android/api.d.ts +51 -43
  15. package/lib/typescript/codegen/android/callback.d.ts +166 -0
  16. package/lib/typescript/codegen/android/errorcode.d.ts +123 -2
  17. package/lib/typescript/codegen/android/keytype.d.ts +501 -13
  18. package/lib/typescript/codegen/ios/api.d.ts +232 -16
  19. package/lib/typescript/codegen/ios/callback.d.ts +137 -1
  20. package/lib/typescript/codegen/ios/errorcode.d.ts +104 -0
  21. package/lib/typescript/codegen/ios/keytype.d.ts +460 -6
  22. package/lib/typescript/codegen/pack/api.d.ts +66 -57
  23. package/lib/typescript/codegen/pack/callback.d.ts +45 -21
  24. package/lib/typescript/codegen/pack/errorcode.d.ts +45 -15
  25. package/lib/typescript/codegen/pack/keytype.d.ts +388 -114
  26. package/lib/typescript/core/api.d.ts +13 -0
  27. package/lib/typescript/core/keytype.d.ts +18 -2
  28. package/package.json +1 -1
  29. package/react-native-velive-pull.podspec +12 -3
  30. package/ios/pictureInpicture/VeLivePictureInPictureController.h +0 -207
  31. package/ios/pictureInpicture/VeLivePictureInPictureController.m +0 -3393
@@ -1,5 +1,5 @@
1
1
  import { String, SurfaceHolder, Surface, float, Map, List, int } from './types';
2
- import { VeLivePlayerLogLevel, VeLivePlayerConfiguration, VeLivePlayerFillMode, VeLivePlayerStreamData, VeLivePlayerResolution, VeLivePlayerPixelFormat, VeLivePlayerVideoBufferType, VeLivePlayerRotation, VeLivePlayerMirror } from './keytype';
2
+ import { VeLivePlayerLogLevel, VeLivePlayerConfiguration, VeLivePlayerFillMode, VeLivePlayerStreamData, VeLivePlayerResolution, VeLivePlayerPixelFormat, VeLivePlayerVideoBufferType, VeLivePlayerAudioBufferType, VeLivePlayerRotation, VeLivePlayerMirror } from './keytype';
3
3
  import { VeLivePlayerObserver } from './callback';
4
4
  import { ApplicationContext } from './external';
5
5
  export declare class VeLivePlayer {
@@ -29,7 +29,7 @@ export declare class VeLivePlayer {
29
29
  * @brief Initializes the player and configures whether to turn on SEI messaging, hardware decoding, local DNS prefetch, and other configurations.
30
30
  * @notes <br>Call this method to initialize the player before calling [play](#VeLivePlayer-play) .
31
31
  * @order 1
32
- * @param config Player configurations. Refer to VeLivePlayerConfiguration {@link #VeLivePlayerConfiguration} for details.
32
+ * @param config Player configurations. Refer to VeLivePlayerConfiguration{@link #VeLivePlayerConfiguration} for details.
33
33
  *
34
34
  */
35
35
  setConfig(config: VeLivePlayerConfiguration): void;
@@ -37,9 +37,9 @@ export declare class VeLivePlayer {
37
37
  /** {en}
38
38
  * @detail api
39
39
  * @brief Sets the player observer to listen to the live player's events, such as playback errors or status updates, rendering of the first audio and video frame, and resolution switching.
40
- * @notes <br>
41
- * Call this method before calling play {@link #play}.
42
- * @param observer The player observer. See VeLivePlayerObserver {@link #VeLivePlayerObserver} for details.
40
+ * @notes
41
+ * Call this method before calling [play](#VeLivePlayer-play).
42
+ * @param observer The player observer. See VeLivePlayerObserver{@link #VeLivePlayerObserver} for details.
43
43
  * @order 2
44
44
  *
45
45
  */
@@ -52,7 +52,7 @@ export declare class VeLivePlayer {
52
52
  * - Call this method before calling [play](#VeLivePlayer-play) to set the initial fill mode of the player.
53
53
  * - You can call this method during playback to dynamically adjust the fill mode.
54
54
  * @order 3
55
- * @param fillMode The fill mode of SurfaceView. The default value is `VeLivePlayerFillModeAspectFill`. For details, see VeLivePlayerFillMode {@link #VeLivePlayerFillMode}.
55
+ * @param fillMode The fill mode of SurfaceView. The default value is `VeLivePlayerFillModeAspectFill`. For details, see VeLivePlayerFillMode{@link #VeLivePlayerFillMode}.
56
56
  *
57
57
  */
58
58
  setRenderFillMode(fillMode: VeLivePlayerFillMode): Promise<void>;
@@ -60,8 +60,8 @@ export declare class VeLivePlayer {
60
60
  /** {en}
61
61
  * @detail api
62
62
  * @brief Sets the `SurfaceHolder` object for video rendering and playback. Use this method if you use `SurfaceView` for playback.
63
- * @notes <br>
64
- * If you call both `setSurfaceHolder` and setSurface {@link #setSurface} to set the `Surface` object, the player will prioritize the configurations of `surfaceHolder`.
63
+ * @notes
64
+ * If you call both setSurfaceHolder and [setSurface](#VeLivePlayer-setsurface) to set the `Surface` object, the player will prioritize the configurations of `surfaceHolder`.
65
65
  * @param surfaceHolder The `SurfaceHolder` object.
66
66
  * @order 6
67
67
  *
@@ -71,8 +71,8 @@ export declare class VeLivePlayer {
71
71
  /** {en}
72
72
  * @detail api
73
73
  * @brief Sets the `Surface` object for video rendering and playback. Use this method if you use `SurfaceView` or `TextureView` for playback.
74
- * @notes <br>
75
- * If you call both setSurfaceHolder {@link #setSurfaceHolder} and `setSurface` to set the `Surface` object, the player will prioritize the configurations of `surfaceHolder`.
74
+ * @notes
75
+ * If you call both [setSurfaceHolder](#VeLivePlayer-setsurfaceholder) and `setSurface` to set the `Surface` object, the player will prioritize the configurations of `surfaceHolder`.
76
76
  * @param surface The `Surface` object.
77
77
  * @order 7
78
78
  *
@@ -94,7 +94,7 @@ export declare class VeLivePlayer {
94
94
  * @brief Sets multiple live streams. Call this method if you need to enable features requiring multiple live streams, such as adaptive bitrate (ABR), manual resolution switching, and primary and backup streams.
95
95
  * @notes <br>Call this method before calling play.
96
96
  * @order 8
97
- * @param streamData Configurations for multiple pull stream addresses. For details, see VeLivePlayerStreamData {@link #VeLivePlayerStreamData}.
97
+ * @param streamData Configurations for multiple pull stream addresses. For details, see [VeLivePlayerStreamData](player-android-api-keytype#VeLivePlayerStreamData).
98
98
  *
99
99
  */
100
100
  setPlayStreamData(streamData: VeLivePlayerStreamData): void;
@@ -102,8 +102,8 @@ export declare class VeLivePlayer {
102
102
  /** {en}
103
103
  * @detail api
104
104
  * @brief Starts or resumes playback.
105
- * @notes <br>
106
- * After you call this method, the onPlayerStatusUpdate {@link #VeLivePlayerObserver #onPlayerStatusUpdate} callback is triggered both when the player finishes preparing for stream pulling and when the first frame is rendered.
105
+ * @notes
106
+ * After you call this method, the [onPlayerStatusUpdate](docs-player-android-api-callback#VeLivePlayerObserver-onplayerstatusupdate) callback is triggered both when the player finishes preparing for stream pulling and when the first frame is rendered.
107
107
  * @order 8
108
108
  *
109
109
  */
@@ -112,8 +112,8 @@ export declare class VeLivePlayer {
112
112
  /** {en}
113
113
  * @detail api
114
114
  * @brief Pauses playback.
115
- * @notes <br>
116
- * When playback is paused after you call this method, the onPlayerStatusUpdate {@link #VeLivePlayerObserver #onPlayerStatusUpdate} callback is triggered.
115
+ * @notes
116
+ * When playback is paused after you call this method, the [onPlayerStatusUpdate](docs-player-android-api-callback#VeLivePlayerObserver-onplayerstatusupdate) callback is triggered.
117
117
  * @order 8
118
118
  *
119
119
  */
@@ -122,8 +122,8 @@ export declare class VeLivePlayer {
122
122
  /** {en}
123
123
  * @detail api
124
124
  * @brief Stops playback. This method does not destroy the player.
125
- * @notes <br>
126
- * When playback stops after you call this method, the onPlayerStatusUpdate {@link #VeLivePlayerObserver #onPlayerStatusUpdate} callback is triggered.
125
+ * @notes
126
+ * When playback stops after you call this method, the [onPlayerStatusUpdate](docs-player-android-api-callback#VeLivePlayerObserver-onplayerstatusupdate) callback is triggered.
127
127
  * @order 8
128
128
  *
129
129
  */
@@ -141,12 +141,12 @@ export declare class VeLivePlayer {
141
141
  * @detail api
142
142
  * @brief Changes the video resolution.
143
143
  * @notes - Call [setPlayStreamData](#VeLivePlayer-setplaystreamdata) to set multiple resolutions before calling this method.
144
- * - Once the player switches to the new resolution after you call this method, the [onResolutionSwitch](player-android-api-callback#VeLivePlayerObserver-onresolutionswitch) callback is triggered.
144
+ * - Once the player switches to the new resolution after you call this method, the [onResolutionSwitch](docs-player-android-api-callback#VeLivePlayerObserver-onresolutionswitch) callback is triggered.
145
+ * @order 8
146
+ * @param resolution The video resolution. For details, refer to VeLivePlayerResolution
145
147
  * @return <br>
146
148
  * - true: Success;
147
149
  * - false: Failure.
148
- * @order 8
149
- * @param resolution The video resolution. For details, refer to VeLivePlayerResolution {@link #VeLivePlayerResolution}.
150
150
  *
151
151
  */
152
152
  switchResolution(resolution: VeLivePlayerResolution): boolean;
@@ -198,13 +198,15 @@ export declare class VeLivePlayer {
198
198
  * @brief Sets the mapping of domain names to server IP addresses.
199
199
  * @param hostIpMap The mapping of domain names to server IP addresses. The `Map` object uses the domain name as the key, and the corresponding value is a list of IP addresses for the servers associated with that domain. The value is of the `List` type.
200
200
  * @order 11
201
+ * @notes - When using setUrlHostIP to map domain names and IP addresses, disable the DNS pre-resolution feature in the initial configuration by setting [enableLiveDNS](docs-player-android-api-keytype#VeLivePlayerConfiguration-enablelivedns) to false.
202
+ * - Call this method to set the mapping of domain names and IP addresses before calling [play](#VeLivePlayer-play) to start playback.
201
203
  *
202
204
  */
203
205
  setUrlHostIP(hostIpMap: Map<String, List<String>>): void;
204
206
 
205
207
  /** {en}
206
208
  * @detail api
207
- * @brief Configures advanced settings for the player, including offscreen rendering, maximum buffer duration, and adaptive bitrate (ABR) algorithms. Contact BytePlus technical support if you need further information.
209
+ * @brief Configures advanced settings for the player, including offscreen rendering, maximum buffer duration, and adaptive bitrate (ABR) algorithms. [Create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support if you need further information.
208
210
  * @param key The parameter name of the advanced setting.
209
211
  * @param value The parameter value of the advanced setting.
210
212
  * @order 12
@@ -215,13 +217,13 @@ export declare class VeLivePlayer {
215
217
  /** {en}
216
218
  * @detail api
217
219
  * @brief Takes a screenshot of the video.
218
- * @notes <br>
219
- * - This method only takes effect during playback.
220
- * - When a screenshot is captured after you call this method, the onSnapshotComplete {@link #VeLivePlayerObserver #onSnapshotComplete} callback is triggered containing the Bitmap object of the screenshot.
221
- * @return <br>
222
- * - 0: Screenshot capturing is allowed.
223
- * - [VeLivePlayerErrorRefused](player-android-api-errorcode#VeLivePlayerErrorCode-veliveplayererrorrefused) : Screenshot capturing is not allowed.
220
+ * @notes
221
+ * - This method only takes effect during playback.
222
+ * - When a screenshot is captured after you call this method, the [onSnapshotComplete](docs-player-android-api-callback#VeLivePlayerObserver-onsnapshotcomplete) callback is triggered containing the Bitmap object of the screenshot.
224
223
  * @order 13
224
+ * @return
225
+ * - 0: Screenshot capturing is allowed.
226
+ * - [VeLivePlayerErrorRefused](docs-player-android-api-errorcode#VeLivePlayerErrorCode-veliveplayererrorrefused) : Screenshot capturing is not allowed.
225
227
  *
226
228
  */
227
229
  snapshot(): int;
@@ -232,12 +234,12 @@ export declare class VeLivePlayer {
232
234
  * @param enable Whether to enable the video frame callback. The default value is `false`. <br>
233
235
  * - true: Enable;
234
236
  * - false: Disable.
235
- * @param pixelFormat The pixel format of the video frame in the callback. See VeLivePlayerPixelFormat {@link #VeLivePlayerPixelFormat} for details.
236
- * @param bufferType The encapsulation format of the video data in the callback. For details, see VeLivePlayerVideoBufferType {@link #VeLivePlayerVideoBufferType}.
237
- * @notes <br>
238
- * - You can call this method to subscribe to decoded video data for external rendering.
239
- * - After you call this method, the onRenderVideoFrame {@link #VeLivePlayerObserver #onRenderVideoFrame} callback is triggered once the SDK receives a video frame. The callback contains detailed information about the video frame.
240
- * - If you use external rendering, you need to make sure the video and audio are synchronized.
237
+ * @param pixelFormat The pixel format of the video frame in the callback. See VeLivePlayerPixelFormat{@link #VeLivePlayerPixelFormat} for details.
238
+ * @param bufferType The encapsulation format of the video data in the callback. For details, see VeLivePlayerVideoBufferType{@link #VeLivePlayerVideoBufferType}.
239
+ * @notes
240
+ * - You can call this method to subscribe to decoded video data for external rendering.
241
+ * - After you call this method, the [onRenderVideoFrame](docs-player-android-api-callback#VeLivePlayerObserver-onrendervideoframe) callback is triggered once the SDK receives a video frame. The callback contains detailed information about the video frame.
242
+ * - If you use external rendering, you need to make sure the video and audio are synchronized.
241
243
  * @order 14
242
244
  *
243
245
  */
@@ -246,25 +248,27 @@ export declare class VeLivePlayer {
246
248
  /** {en}
247
249
  * @detail api
248
250
  * @brief Sets the audio frame observer.
249
- * @notes <br>
251
+ * @notes
250
252
  * - You can call this method to subscribe to decoded audio data if you want to use external rendering.
251
- * - After you call this method, the [onRenderAudioFrame](player-android-api-callback#VeLivePlayerObserver-onrenderaudioframe) callback is triggered once the SDK receives an audio frame. The callback contains detailed information about the audio frame.
253
+ * - After you call this method, the [onRenderAudioFrame](docs-player-android-api-callback#VeLivePlayerObserver-onrenderaudioframe) callback is triggered once the SDK receives an audio frame. The callback contains detailed information about the audio frame.
252
254
  * - If you use external rendering, you need to make sure the video and audio are synchronized.
253
255
  * @order 15
256
+ *
254
257
  * @param enable Whether to enable the audio frame callback. The default value is `false`. <br>
255
258
  * - true: Enable;
256
259
  * - false: Disable.
257
260
  * @param enableRendering Whether to enable player rendering. The default value is `false`. <br>
258
261
  * - true: Enable;
259
262
  * - false: Disable.
263
+ * @param bufferType Audio buffer type. For details, please refer to [VeLivePlayerAudioBufferType](docs-player-android-api-keytype#VeLivePlayerAudioBufferType).
260
264
  *
261
265
  */
262
- enableAudioFrameObserver(enable: boolean, enableRendering: boolean): void;
266
+ enableAudioFrameObserver(enable: boolean, enableRendering: boolean, bufferType: VeLivePlayerAudioBufferType): void;
263
267
 
264
268
  /** {en}
265
269
  * @detail api
266
270
  * @brief Sets the clockwise rotation angle of the video.
267
- * @param rotation The clockwise rotation angle of the video. Rotation is disabled by default. See VeLivePlayerRotation {@link #VeLivePlayerRotation} for details.
271
+ * @param rotation The clockwise rotation angle of the video. Rotation is disabled by default. See VeLivePlayerRotation{@link #VeLivePlayerRotation} for details.
268
272
  * @notes <br>
269
273
  * - You can change the rotation angle before and during playback.
270
274
  * - Each time this method is called, the player rotates the video based on the original video.
@@ -277,7 +281,7 @@ export declare class VeLivePlayer {
277
281
  /** {en}
278
282
  * @detail api
279
283
  * @brief Configures mirroring settings.
280
- * @param mirror Mirroring settings. Mirroring is disabled by default. See VeLivePlayerMirror {@link #VeLivePlayerMirror} for details.
284
+ * @param mirror Mirroring settings. Mirroring is disabled by default. See VeLivePlayerMirror{@link #VeLivePlayerMirror} for details.
281
285
  * @notes <br>
282
286
  * - You can change the mirroring settings before and during playback.
283
287
  * - Each time this method is called, the player applies the mirroring settings to the original video.
@@ -289,11 +293,14 @@ export declare class VeLivePlayer {
289
293
 
290
294
  /** {en}
291
295
  * @detail api
292
- * @brief Enables or disables super resolution. You must first contact the BytePlus [technical support](https://www.byteplus.com/en/support) to activate the feature before using it.
293
- * @param enable Whether to enable super resolution.
294
- * @notes <br>
295
- * - Call this method after receiving the onFirstVideoFrameRender{@link #VeLivePlayerObserver#onFirstVideoFrameRender} callback, or during playback.
296
- * - If the SDK fails to enable super resolution due to device model, video resolution or frame rate, you will receive the onStreamFailedOpenSuperResolution{@link #VeLivePlayerObserver#onStreamFailedOpenSuperResolution} callback.
296
+ * @brief Enables or disables super resolution. You must first contact BytePlus [technical support](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to activate the feature before using it.
297
+ * @param enable Whether to enable super resolution. The default value is false.
298
+ * - true: enable;
299
+ * - false: disable.
300
+ * @notes
301
+ * - Call this method after receiving the [onFirstVideoFrameRender](docs-player-android-api-callback#VeLivePlayerObserver-onfirstvideoframerender) callback, or during playback.
302
+ * - Support dynamically enabling and disabling super-resolution by calling this interface during playback.
303
+ * - If the SDK fails to enable super resolution due to device model, video resolution or frame rate, you will receive the [onStreamFailedOpenSuperResolution](docs-player-android-api-callback#VeLivePlayerObserver-onstreamfailedopensuperresolution) callback.
297
304
  * @order 18
298
305
  *
299
306
  */
@@ -307,4 +314,5 @@ export declare class VeLivePlayer {
307
314
  *
308
315
  */
309
316
  setEnableSharpen(enable: boolean): void;
317
+ addExtraHttpRequestHeadersByUser(headers: Map): void;
310
318
  }
@@ -4,37 +4,203 @@ import { long, int, String, Bitmap } from './types';
4
4
  import { VeLivePlayerResolution, VeLivePlayerResolutionSwitchReason, VeLivePlayerStreamType, VeLivePlayerStatus, VeLivePlayerStatistics, VeLivePlayerVideoFrame, VeLivePlayerAudioFrame } from './keytype';
5
5
  export declare class VeLivePlayerObserver {
6
6
 
7
+ /** {en}
8
+ * @detail callback
9
+ * @brief Occurs when a player error occurs.
10
+ * @param player The player object that triggers the callback function.
11
+ * @param error The error message. Refer to VeLivePlayerError{@link #VeLivePlayerError} for details.
12
+ * @order 1
13
+ *
14
+ */
7
15
  onError?(player: VeLivePlayer, error: VeLivePlayerError): void;
8
16
 
17
+ /** {en}
18
+ * @detail callback
19
+ * @brief Occurs when the first video frame is rendered at the beginning of playback or after a retry during playback.
20
+ * @param player The player object that triggers the callback function.
21
+ * @param isFirstFrame Whether the video frame is the first video frame rendered at the beginning of playback. <br>
22
+ * - true: The video frame is the first video frame rendered at the beginning of playback;
23
+ * - false: The video frame is the first video frame rendered after a retry during playback.
24
+ * @order 2
25
+ *
26
+ */
9
27
  onFirstVideoFrameRender?(player: VeLivePlayer, isFirstFrame: boolean): void;
10
28
 
29
+ /** {en}
30
+ * @detail callback
31
+ * @brief Occurs when the first audio frame is rendered at the beginning of playback or after a retry during playback.
32
+ * @param player The player object that triggers the callback function.
33
+ * @param isFirstFrame Whether the audio frame is the first audio frame rendered at the beginning of playback. <br>
34
+ * - true: The audio frame is the first audio frame rendered at the beginning of playback;
35
+ * - false: The audio frame is the first audio frame rendered after a retry during playback.
36
+ * @order 3
37
+ *
38
+ */
11
39
  onFirstAudioFrameRender?(player: VeLivePlayer, isFirstFrame: boolean): void;
12
40
 
41
+ /** {en}
42
+ * @detail callback
43
+ * @brief Occurs when a playback stutter starts.
44
+ * @param player The player object that triggers the callback function.
45
+ * @order 4
46
+ *
47
+ */
13
48
  onStallStart?(player: VeLivePlayer): void;
14
49
 
50
+ /** {en}
51
+ * @detail callback
52
+ * @brief Occurs when a playback stutter stops, that is, when playback resumes after there is enough audio buffer.
53
+ * @param player The player object that triggers the callback function.
54
+ * @order 5
55
+ *
56
+ */
15
57
  onStallEnd?(player: VeLivePlayer): void;
16
58
 
59
+ /** {en}
60
+ * @detail callback
61
+ * @brief Occurs when video rendering stutters.
62
+ * @param player The player object that triggers the callback function.
63
+ * @param stallTime The stutter duration, in milliseconds.
64
+ * @order 6
65
+ *
66
+ */
17
67
  onVideoRenderStall?(player: VeLivePlayer, stallTime: long): void;
18
68
 
69
+ /** {en}
70
+ * @detail callback
71
+ * @brief Occurs when audio rendering stutters.
72
+ * @param player The player object that triggers the callback function.
73
+ * @param stallTime The stutter duration, in milliseconds.
74
+ * @order 7
75
+ *
76
+ */
19
77
  onAudioRenderStall?(player: VeLivePlayer, stallTime: long): void;
20
78
 
79
+ /** {en}
80
+ * @detail callback
81
+ * @brief Occurs when the video resolution changes.
82
+ * @param player The player object that triggers the callback function.
83
+ * @param resolution The updated resolution. See [VeLivePlayerResolution](docs-player-android-api-keytype#VeLivePlayerResolution) for details.
84
+ * @param error Whether an error occurred during resolution switching. See VeLivePlayerError{@link #VeLivePlayerError} for details.
85
+ * @param reason The reason for resolution switching. See VeLivePlayerResolutionSwitchReason{@link #VeLivePlayerResolutionSwitchReason} for details.
86
+ * @order 8
87
+ *
88
+ */
21
89
  onResolutionSwitch?(player: VeLivePlayer, resolution: VeLivePlayerResolution, error: VeLivePlayerError, reason: VeLivePlayerResolutionSwitchReason): void;
22
90
 
91
+ /** {en}
92
+ * @detail callback
93
+ * @brief Occurs when the video size changes.
94
+ * @param player The player object that triggers the callback function.
95
+ * @param width The updated width of the video, in pixels.
96
+ * @param height The updated height of the video, in pixels.
97
+ * @order 9
98
+ *
99
+ */
23
100
  onVideoSizeChanged?(player: VeLivePlayer, width: int, height: int): void;
24
101
 
102
+ /** {en}
103
+ * @detail callback
104
+ * @brief String SEI message callback. This callback is triggered when the player SDK receives an SEI message. It is necessary to enable the `enableSei` property in `VeLivePlayerConfiguration`. When the `enableBinarySei` property is enabled, the string SEI message will no longer be sent.
105
+ * @param player The player object that triggers the callback function.
106
+ * @param message The SEI message.
107
+ * @order 10
108
+ *
109
+ */
25
110
  onReceiveSeiMessage?(player: VeLivePlayer, message: String): void;
26
111
 
112
+ /** {en}
113
+ * @detail callback
114
+ * @brief Binary SEI message callback. This callback is triggered when the player SDK receives an SEI message. It is necessary to enable the `enableBinarySei` property in `VeLivePlayerConfiguration`. When the `enableBinarySei` property is enabled, the string SEI message will no longer be sent.
115
+ * @param player The player object that triggers the callback function.
116
+ * @param message The SEI message.
117
+ * @order 10
118
+ *
119
+ */
120
+ onReceiveBinarySeiMessage?(player: VeLivePlayer, message: ArrayBuffer): void;
121
+
122
+ /** {en}
123
+ * @detail callback
124
+ * @brief Occurs when the player switches between the primary stream and the backup stream.
125
+ * @param player The player object that triggers the callback function.
126
+ * @param streamType The type of the updated stream. For details, see VeLivePlayerStreamType{@link #VeLivePlayerStreamType}.
127
+ * @param error The reason for the switch. For details, see VeLivePlayerError{@link #VeLivePlayerError}.
128
+ * @order 11
129
+ *
130
+ */
27
131
  onMainBackupSwitch?(player: VeLivePlayer, streamType: VeLivePlayerStreamType, error: VeLivePlayerError): void;
28
132
 
133
+ /** {en}
134
+ * @detail callback
135
+ * @brief Occurs when the playback status changes.
136
+ * @param player The player object that triggers the callback function.
137
+ * @param status The updated status of the player. See VeLivePlayerStatus{@link #VeLivePlayerStatus} for details.
138
+ * @order 12
139
+ *
140
+ */
29
141
  onPlayerStatusUpdate?(player: VeLivePlayer, status: VeLivePlayerStatus): void;
30
142
 
143
+ /** {en}
144
+ * @detail callback
145
+ * @brief Occurs periodically to report information such as the current pull stream address, bitrate, and frame rate.
146
+ * @param player The player object that triggers the callback function.
147
+ * @param statistics The playback statistics. For details, see VeLivePlayerStatistics{@link #VeLivePlayerStatistics}.
148
+ * @order 13
149
+ *
150
+ */
31
151
  onStatistics?(player: VeLivePlayer, statistics: VeLivePlayerStatistics): void;
32
152
 
153
+ /** {en}
154
+ * @detail callback
155
+ * @brief Occurs when a screenshot is taken after snapshot{@link #VeLivePlayer#snapshot} is called.
156
+ * @param player The player object that triggers the callback function.
157
+ * @param bitmap The Bitmap object of the screenshot.
158
+ * @order 14
159
+ *
160
+ */
33
161
  onSnapshotComplete?(player: VeLivePlayer, bitmap: Bitmap): void;
34
162
 
163
+ /** {en}
164
+ * @detail callback
165
+ * @brief Occurs when the player decodes a video frame. Call [enableVideoFrameObserver](docs-player-android-api-reference#VeLivePlayer-enablevideoframeobserver) to enable video frame callback.
166
+ * @notes <br>
167
+ * If you use the texture format for external rendering, we recommend that you render the video in the callback thread.
168
+ * @order 15
169
+ * @param player The player object that triggers the callback function.
170
+ * @param videoFrame The video frame, including the pixel format, encapsulation format, width and height of the video, and other information. See VeLivePlayerVideoFrame{@link #VeLivePlayerVideoFrame} for details.
171
+ *
172
+ */
35
173
  onRenderVideoFrame?(player: VeLivePlayer, videoFrame: VeLivePlayerVideoFrame): void;
36
174
 
175
+ /** {en}
176
+ * @detail callback
177
+ * @brief Occurs when the player decodes an audio frame. Call enableAudioFrameObserver{@link #VeLivePlayer#enableAudioFrameObserver} to enable audio frame callback.
178
+ * @param player The player object that triggers the callback function.
179
+ * @param audioFrame The audio frame. See VeLivePlayerAudioFrame{@link #VeLivePlayerAudioFrame} for details.
180
+ * @notes <br>
181
+ * The audio data returned by the callback is of type Float32 and in big-endian byte order.
182
+ * @order 16
183
+ *
184
+ */
37
185
  onRenderAudioFrame?(player: VeLivePlayer, audioFrame: VeLivePlayerAudioFrame): void;
38
186
 
187
+ /** {en}
188
+ * @detail callback
189
+ * @brief Occurs when the SDK fails to enable super resolution after setEnableSuperResolution{@link #VeLivePlayer#setEnableSuperResolution} is called.
190
+ * @order 17
191
+ * @param player The player object that triggers the callback function.
192
+ * @param error The reason of the failure. See [VeLivePlayerErrorCode](docs-player-android-api-errorcode#VeLivePlayerErrorCode) for details.
193
+ *
194
+ */
39
195
  onStreamFailedOpenSuperResolution?(player: VeLivePlayer, error: VeLivePlayerError): void;
196
+
197
+ /** {en}
198
+ * @detail callback
199
+ * @brief Occurs when the SDK fails to enable sharpen after [setEnableSuperResolution](docs-player-android-api-reference#VeLivePlayer-setenablesuperresolution) is called.
200
+ * @param player The player object that triggers the callback function.
201
+ * @param error The reason of the failure. See [VeLivePlayerErrorCode](docs-player-android-api-errorcode#VeLivePlayerErrorCode) for details.
202
+ * @order 18
203
+ *
204
+ */
205
+ onStreamFailedOpenSharpen?(player: VeLivePlayer, error: VeLivePlayerError): void;
40
206
  }
@@ -1,53 +1,174 @@
1
1
  import { int, String } from './types';
2
2
  export declare class VeLivePlayerError {
3
- constructor(errorCode: int, errorMsg: String);
4
- constructor(errorCode: int);
3
+ constructor(errorCode: int, subCode: int, errorMsg: String);
5
4
 
5
+ /** {en}
6
+ * @brief The error code.
7
+ *
8
+ */
6
9
  mErrorCode: int;
7
10
 
11
+ /** {en}
12
+ * @brief The error message.
13
+ *
14
+ */
8
15
  mErrorMsg: String;
16
+
17
+ /** {en}
18
+ * @brief The sub error code.
19
+ *
20
+ */
21
+ mSubCode: int;
9
22
  }
10
23
  export declare enum VeLivePlayerErrorCode {
11
24
 
25
+ /** {en}
26
+ * @brief No error.
27
+ *
28
+ */
12
29
  VeLivePlayerNoError = 0,
13
30
 
31
+ /** {en}
32
+ * @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.
33
+ *
34
+ */
14
35
  VeLivePlayerInvalidLicense = -1,
15
36
 
37
+ /** {en}
38
+ * @brief Invalid parameters. Check the input parameter and call the method again.
39
+ *
40
+ */
16
41
  VeLivePlayerInvalidParameter = -2,
17
42
 
43
+ /** {en}
44
+ * @brief The method call has been rejected. This error occurs when the method is called at an incorrect time.
45
+ *
46
+ */
18
47
  VeLivePlayerErrorRefused = -3,
19
48
 
49
+ /** {en}
50
+ * @brief Failed to load the library file. This error may occur due to incorrect integration of the SDK.
51
+ *
52
+ */
20
53
  VeLivePlayerErrorLibraryLoadFailed = -4,
21
54
 
55
+ /** {en}
56
+ * @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.
57
+ *
58
+ */
22
59
  VeLivePlayerErrorPlayUrl = -100,
23
60
 
61
+ /** {en}
62
+ * @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.
63
+ *
64
+ */
24
65
  VeLivePlayerErrorNoStreamData = -101,
25
66
 
67
+ /** {en}
68
+ * @brief An internal retry to play the live stream, which might happen due to an internal player error.
69
+ *
70
+ */
26
71
  VeLivePlayerErrorInternalRetryStart = -102,
27
72
 
73
+ /** {en}
74
+ * @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.
75
+ *
76
+ */
28
77
  VeLivePlayerErrorInternalRetryFailed = -103,
29
78
 
79
+ /** {en}
80
+ * @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, [create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support for assistance.
81
+ *
82
+ */
30
83
  VeLivePlayerErrorDnsParseFailed = -200,
31
84
 
85
+ /** {en}
86
+ * @brief The network request failed. Check the network conditions. If the error persists, [create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support for assistance.
87
+ *
88
+ */
32
89
  VeLivePlayerErrorNetworkRequestFailed = -201,
33
90
 
91
+ /** {en}
92
+ * @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, [create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support for assistance.
93
+ *
94
+ */
34
95
  VeLivePlayerErrorDemuxFailed = -300,
35
96
 
97
+ /** {en}
98
+ * @brief Decoding failed. This error may occur if the live stream uses an unsupported audio or video format. If the error persists, [create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support for assistance.
99
+ *
100
+ */
36
101
  VeLivePlayerErrorDecodeFailed = -301,
37
102
 
103
+ /** {en}
104
+ * @brief Rendering failed. This error may occur if there is an issue with the audio or video output devices. If the error persists, [create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support for assistance.
105
+ *
106
+ */
38
107
  VeLivePlayerErrorAVOutputFailed = -302,
39
108
 
109
+ /** {en}
110
+ * @brief The device model does not support super resolution. [Create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support for any assistance you may need.
111
+ *
112
+ */
40
113
  VeLivePlayerErrorSRDeviceUnsupported = -303,
41
114
 
115
+ /** {en}
116
+ * @brief The current resolution exceeds the upper limit allowed for super resolution. [Create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support for any assistance you may need.
117
+ *
118
+ */
42
119
  VeLivePlayerErrorSRResolutionUnsupported = -304,
43
120
 
121
+ /** {en}
122
+ * @brief The current frame rate exceeds the upper limit allowed for super resolution. [Create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support for any assistance you may need.
123
+ *
124
+ */
44
125
  VeLivePlayerErrorSRFpsUnsupported = -305,
45
126
 
127
+ /** {en}
128
+ * @brief Fails to initialize super resolution. [Create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support if the error persists.
129
+ *
130
+ */
46
131
  VeLivePlayerErrorSRInitFail = -306,
47
132
 
133
+ /** {en}
134
+ * @brief Fails to apply super resolution to the video. [Create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support if the error persists.
135
+ *
136
+ */
48
137
  VeLivePlayerErrorSRExecuteFail = -307,
49
138
 
139
+ /** {en}
140
+ * @brief The current SDK license does not provide support for the H.265 feature.
141
+ *
142
+ */
50
143
  VeLivePlayerLicenseUnsupportedH265 = -308,
51
144
 
145
+ /** {en}
146
+ * @brief The device model does not support sharpen. [Create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support for any assistance you may need.
147
+ *
148
+ */
149
+ VeLivePlayerErrorSharpenDeviceUnsupported = -309,
150
+
151
+ /** {en}
152
+ * @hidden (Android)
153
+ *
154
+ */
155
+ VeLivePlayerErrorNotSupportTextureRender = -508,
156
+
157
+ /** {en}
158
+ * @hidden (Android)
159
+ *
160
+ */
161
+ VeLivePlayerErrorInitICEffectFail = -509,
162
+
163
+ /** {en}
164
+ * @hidden (Android)
165
+ *
166
+ */
167
+ VeLivePlayerErrorNotSupportResolutionSwitch = -510,
168
+
169
+ /** {en}
170
+ * @brief Internal error. Please [create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support for assistance.
171
+ *
172
+ */
52
173
  VeLivePlayerErrorInternal = -999
53
174
  }