@volcengine/react-native-live-pull 1.0.2 → 1.0.3-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.
- package/README.md +1 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/volcengine/velive/rn/pull/VolcLiveModule.java +1 -1
- package/android/src/main/java/com/volcengine/velive/rn/pull/VolcViewManager.java +1 -1
- package/ios/VeLivePullView.m +1 -1
- package/ios/VeLivePullViewManager.m +1 -1
- package/lib/commonjs/index.js +12227 -8161
- package/lib/module/index.js +12228 -8160
- package/lib/typescript/codegen/android/api.d.ts +76 -22
- package/lib/typescript/codegen/android/callback.d.ts +21 -4
- package/lib/typescript/codegen/android/errorcode.d.ts +25 -2
- package/lib/typescript/codegen/android/external.d.ts +1 -0
- package/lib/typescript/codegen/android/index.d.ts +1 -0
- package/lib/typescript/codegen/android/keytype.d.ts +119 -15
- package/lib/typescript/codegen/android/types.d.ts +7 -6
- package/lib/typescript/codegen/ios/api.d.ts +13 -27
- package/lib/typescript/codegen/ios/callback.d.ts +19 -33
- package/lib/typescript/codegen/ios/external.d.ts +1 -0
- package/lib/typescript/codegen/ios/index.d.ts +1 -0
- package/lib/typescript/codegen/ios/keytype.d.ts +0 -56
- package/lib/typescript/codegen/ios/types.d.ts +16 -5
- package/lib/typescript/codegen/pack/api.d.ts +93 -117
- package/lib/typescript/codegen/pack/callback.d.ts +73 -56
- package/lib/typescript/codegen/pack/errorcode.d.ts +65 -45
- package/lib/typescript/codegen/pack/external.d.ts +1 -0
- package/lib/typescript/codegen/pack/index.d.ts +2 -1
- package/lib/typescript/codegen/pack/keytype.d.ts +501 -544
- package/lib/typescript/codegen/pack/types.d.ts +68 -1
- package/lib/typescript/component.d.ts +9 -2
- package/lib/typescript/core/keytype.d.ts +1 -1
- package/lib/typescript/platforms/ios/extends.d.ts +2 -0
- package/package.json +6 -4
- package/react-native-velive-pull.podspec +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
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
3
|
import { VeLivePlayerObserver } from './callback';
|
|
3
|
-
import {
|
|
4
|
-
import { ApplicationContext } from '../../platforms/android/extends';
|
|
4
|
+
import { ApplicationContext } from './external';
|
|
5
5
|
export declare class VeLivePlayer {
|
|
6
6
|
/** {zh}
|
|
7
7
|
* @detail api
|
|
@@ -9,30 +9,39 @@ export declare class VeLivePlayer {
|
|
|
9
9
|
* @return <br>
|
|
10
10
|
* 播放器 SDK 版本号。
|
|
11
11
|
* @order 4
|
|
12
|
+
*
|
|
12
13
|
*/
|
|
14
|
+
|
|
13
15
|
static getVersion(): String;
|
|
14
16
|
/** {zh}
|
|
15
17
|
* @detail api
|
|
16
18
|
* @brief 设置打印的日志级别。
|
|
17
19
|
* @order 5
|
|
18
20
|
* @param logLevel 日志级别,详情请参见 [VeLivePlayerLogLevel](188115#VeLivePlayerLogLevel) 。
|
|
21
|
+
*
|
|
19
22
|
*/
|
|
23
|
+
|
|
20
24
|
static setLogLevel(logLevel: VeLivePlayerLogLevel): void;
|
|
25
|
+
constructor(context: ApplicationContext);
|
|
21
26
|
/** {zh}
|
|
22
27
|
* @detail api
|
|
23
28
|
* @brief 初始化播放器,用于设置是否开启 SEI 消息、是否开启硬件解码和是否开启本地 DNS 预解析等配置信息。
|
|
24
29
|
* @notes <br>需要在调用 [play](#VeLivePlayer-play) 开始播放之前,调用本方法进行播放器的初始化。
|
|
25
30
|
* @order 1
|
|
26
|
-
* @param config 播放器配置信息,详情请参见 {@link #VeLivePlayerConfiguration
|
|
31
|
+
* @param config 播放器配置信息,详情请参见 VeLivePlayerConfiguration{@link #VeLivePlayerConfiguration}。
|
|
32
|
+
*
|
|
27
33
|
*/
|
|
34
|
+
|
|
28
35
|
setConfig(config: VeLivePlayerConfiguration): void;
|
|
29
36
|
/** {zh}
|
|
30
37
|
* @detail api
|
|
31
38
|
* @brief 设置播放器回调,用于监听播放器 VeLivePlayer 的播放错误、播放状态、音视频首帧渲染状态和清晰度档位信息等回调事件。
|
|
32
39
|
* @notes <br>需要在调用 [play](#VeLivePlayer-play) 开始播放之前,调用本方法设置回调。
|
|
33
40
|
* @order 2
|
|
34
|
-
* @param observer 播放器的事件回调对象。详情请参见 {@link #VeLivePlayerObserver
|
|
41
|
+
* @param observer 播放器的事件回调对象。详情请参见 VeLivePlayerObserver{@link #VeLivePlayerObserver}。
|
|
42
|
+
*
|
|
35
43
|
*/
|
|
44
|
+
|
|
36
45
|
setObserver(observer: VeLivePlayerObserver): void;
|
|
37
46
|
/** {zh}
|
|
38
47
|
* @detail api
|
|
@@ -42,73 +51,91 @@ export declare class VeLivePlayer {
|
|
|
42
51
|
* - 如果用于调节填充模式,可以在播放过程中调用本方法动态调节视频的填充模式。
|
|
43
52
|
* @order 3
|
|
44
53
|
* @param fillMode 设置 SurfaceView 的填充模式,默认值为 `VeLivePlayerFillModeAspectFill`,详情请参见 [VeLivePlayerFillMode](188115#VeLivePlayerFillMode)。
|
|
54
|
+
*
|
|
45
55
|
*/
|
|
56
|
+
|
|
46
57
|
setRenderFillMode(fillMode: VeLivePlayerFillMode): Promise<void>;
|
|
47
58
|
/** {zh}
|
|
48
59
|
* @detail api
|
|
49
60
|
* @brief 使用 SurfaceView 播放视频时,通过设置 SurfaceHolder 对象完成视频图像的渲染和播放。
|
|
50
61
|
* @notes <br>
|
|
51
|
-
* 如果同时调用 setSurfaceHolder 和 {@link #setSurface
|
|
62
|
+
* 如果同时调用 setSurfaceHolder 和 setSurface{@link #setSurface} 设置视频播放画面的 Surface,播放器会优先使用 surfaceHolder 的配置。
|
|
52
63
|
* @order 6
|
|
53
64
|
* @param surfaceHolder SurfaceHolder 对象。
|
|
65
|
+
*
|
|
54
66
|
*/
|
|
67
|
+
|
|
55
68
|
setSurfaceHolder(surfaceHolder: SurfaceHolder): void;
|
|
56
69
|
/** {zh}
|
|
57
70
|
* @detail api
|
|
58
71
|
* @brief 使用 SurfaceView 或 TextureView 播放视频时,通过设置 Surface 对象完成视频图像的渲染和播放。
|
|
59
72
|
* @notes <br>
|
|
60
|
-
* 如果同时调用 {@link #setSurfaceHolder
|
|
73
|
+
* 如果同时调用 setSurfaceHolder{@link #setSurfaceHolder} 和 setSurface 设置视频播放画面的 Surface,播放器会优先使用 surfaceHolder 的配置。
|
|
61
74
|
* @order 7
|
|
62
75
|
* @param surface surface 对象的类型。
|
|
76
|
+
*
|
|
63
77
|
*/
|
|
78
|
+
|
|
64
79
|
setSurface(surface: Surface): void;
|
|
65
80
|
/** {zh}
|
|
66
81
|
* @detail api
|
|
67
82
|
* @brief 设置单个直播播放地址。
|
|
68
83
|
* @notes <br>
|
|
69
|
-
* 需要在调用 {@link #play
|
|
84
|
+
* 需要在调用 play{@link #play} 开始播放之前,调用本方法设置单个直播播放地址。
|
|
70
85
|
* @order 8
|
|
71
86
|
* @param url 直播播放地址。
|
|
87
|
+
*
|
|
72
88
|
*/
|
|
89
|
+
|
|
73
90
|
setPlayUrl(url: String): void;
|
|
74
91
|
/** {zh}
|
|
75
92
|
* @detail api
|
|
76
93
|
* @brief 多路流信息配置。例如,您需要使用 ABR、手动切档和主备流等依赖多路流的功能,可以调用本方法进行配置。
|
|
77
94
|
* @notes <br>
|
|
78
|
-
* 需要在调用 {@link #play
|
|
95
|
+
* 需要在调用 play{@link #play} 开始播放之前,调用本方法设置多路流信息。
|
|
79
96
|
* @order 8
|
|
80
97
|
* @param streamData 多路流信息配置,详情请参见 [VeLivePlayerStreamData](188115#VeLivePlayerStreamData) 。
|
|
98
|
+
*
|
|
81
99
|
*/
|
|
100
|
+
|
|
82
101
|
setPlayStreamData(streamData: VeLivePlayerStreamData): void;
|
|
83
102
|
/** {zh}
|
|
84
103
|
* @detail api
|
|
85
104
|
* @brief 开始/恢复播放。
|
|
86
105
|
* @notes <br>
|
|
87
|
-
* 调用本方法,在播放器完成拉流准备和首帧渲染播放后,都会触发 {@link #VeLivePlayerObserver#onPlayerStatusUpdate
|
|
106
|
+
* 调用本方法,在播放器完成拉流准备和首帧渲染播放后,都会触发 onPlayerStatusUpdate{@link #VeLivePlayerObserver#onPlayerStatusUpdate} 播放器状态回调。
|
|
88
107
|
* @order 8
|
|
108
|
+
*
|
|
89
109
|
*/
|
|
110
|
+
|
|
90
111
|
play(): void;
|
|
91
112
|
/** {zh}
|
|
92
113
|
* @detail api
|
|
93
114
|
* @brief 暂停播放。
|
|
94
115
|
* @notes <br>
|
|
95
|
-
* 调用本方法暂停播放后,会触发 {@link #VeLivePlayerObserver#onPlayerStatusUpdate
|
|
116
|
+
* 调用本方法暂停播放后,会触发 onPlayerStatusUpdate{@link #VeLivePlayerObserver#onPlayerStatusUpdate} 播放器状态回调。
|
|
96
117
|
* @order 8
|
|
118
|
+
*
|
|
97
119
|
*/
|
|
120
|
+
|
|
98
121
|
pause(): void;
|
|
99
122
|
/** {zh}
|
|
100
123
|
* @detail api
|
|
101
124
|
* @brief 停止播放,不销毁播放器。
|
|
102
125
|
* @notes <br>
|
|
103
|
-
* 调用本方法停止播放后,会触发 {@link #VeLivePlayerObserver#onPlayerStatusUpdate
|
|
126
|
+
* 调用本方法停止播放后,会触发 onPlayerStatusUpdate{@link #VeLivePlayerObserver#onPlayerStatusUpdate} 播放器状态回调。
|
|
104
127
|
* @order 8
|
|
128
|
+
*
|
|
105
129
|
*/
|
|
130
|
+
|
|
106
131
|
stop(): void;
|
|
107
132
|
/** {zh}
|
|
108
133
|
* @detail api
|
|
109
134
|
* @brief 停止播放,并销毁播放器。
|
|
110
135
|
* @order 8
|
|
136
|
+
*
|
|
111
137
|
*/
|
|
138
|
+
|
|
112
139
|
destroy(): void;
|
|
113
140
|
/** {zh}
|
|
114
141
|
* @detail api
|
|
@@ -120,7 +147,9 @@ export declare class VeLivePlayer {
|
|
|
120
147
|
* - false:失败。
|
|
121
148
|
* @order 8
|
|
122
149
|
* @param resolution 设置清晰度的目标档位,详情请参见 [VeLivePlayerResolution](188115#VeLivePlayerResolution) 。
|
|
150
|
+
*
|
|
123
151
|
*/
|
|
152
|
+
|
|
124
153
|
switchResolution(resolution: VeLivePlayerResolution): boolean;
|
|
125
154
|
/** {zh}
|
|
126
155
|
* @detail api
|
|
@@ -129,14 +158,18 @@ export declare class VeLivePlayer {
|
|
|
129
158
|
* - true:正在播放;
|
|
130
159
|
* - false:未播放。
|
|
131
160
|
* @order 8
|
|
161
|
+
*
|
|
132
162
|
*/
|
|
163
|
+
|
|
133
164
|
isPlaying(): boolean;
|
|
134
165
|
/** {zh}
|
|
135
166
|
* @detail api
|
|
136
167
|
* @brief 设置播放器音量。
|
|
137
168
|
* @order 8
|
|
138
169
|
* @param volume 音量大小,默认值为 1.0。取值范围为 0.0~1.0。
|
|
170
|
+
*
|
|
139
171
|
*/
|
|
172
|
+
|
|
140
173
|
setPlayerVolume(volume: float): void;
|
|
141
174
|
/** {zh}
|
|
142
175
|
* @detail api
|
|
@@ -145,7 +178,9 @@ export declare class VeLivePlayer {
|
|
|
145
178
|
* - true:开启;
|
|
146
179
|
* - false:关闭。
|
|
147
180
|
* @order 9
|
|
181
|
+
*
|
|
148
182
|
*/
|
|
183
|
+
|
|
149
184
|
setMute(mute: boolean): void;
|
|
150
185
|
/** {zh}
|
|
151
186
|
* @detail api
|
|
@@ -154,14 +189,18 @@ export declare class VeLivePlayer {
|
|
|
154
189
|
* - true:静音;
|
|
155
190
|
* - false:未静音。
|
|
156
191
|
* @order 10
|
|
192
|
+
*
|
|
157
193
|
*/
|
|
194
|
+
|
|
158
195
|
isMute(): boolean;
|
|
159
196
|
/** {zh}
|
|
160
197
|
* @detail api
|
|
161
198
|
* @brief 设置域名和服务器的 IP 地址映射关系。
|
|
162
199
|
* @order 11
|
|
163
200
|
* @param hostIpMap 域名和服务器 IP 地址的映射关系列表。其中 `Map` 的 Key 是域名,Value 是 `List` 类型,表示该域名对应的服务器 IP 地址列表。
|
|
201
|
+
*
|
|
164
202
|
*/
|
|
203
|
+
|
|
165
204
|
setUrlHostIP(hostIpMap: Map<String, List<String>>): void;
|
|
166
205
|
/** {zh}
|
|
167
206
|
* @detail api
|
|
@@ -169,26 +208,30 @@ export declare class VeLivePlayer {
|
|
|
169
208
|
* @order 12
|
|
170
209
|
* @param key 高级配置的参数名。
|
|
171
210
|
* @param value 参数对应的参数值。
|
|
211
|
+
*
|
|
172
212
|
*/
|
|
213
|
+
|
|
173
214
|
setProperty(key: String, value: Object): void;
|
|
174
215
|
/** {zh}
|
|
175
216
|
* @detail api
|
|
176
217
|
* @brief 视频截图。
|
|
177
|
-
* @notes
|
|
218
|
+
* @notes <br>
|
|
178
219
|
* - 本方法仅在视频状态为播放时生效。
|
|
179
|
-
* - 调用本方法截图成功后,会触发 {@link #VeLivePlayerObserver#onSnapshotComplete
|
|
220
|
+
* - 调用本方法截图成功后,会触发 onSnapshotComplete{@link #VeLivePlayerObserver#onSnapshotComplete} 回调,回调消息中包含截图的 Bitmap 对象。
|
|
180
221
|
* @return <br>
|
|
181
222
|
* - 0:当前状态支持截图;
|
|
182
223
|
* - [VeLivePlayerErrorRefused](188113#VeLivePlayerErrorCode-veliveplayererrorrefused) :当前状态不支持截图。
|
|
183
224
|
* @order 13
|
|
225
|
+
*
|
|
184
226
|
*/
|
|
227
|
+
|
|
185
228
|
snapshot(): int;
|
|
186
229
|
/** {zh}
|
|
187
230
|
* @detail api
|
|
188
231
|
* @brief 设置视频帧回调。
|
|
189
|
-
* @notes
|
|
232
|
+
* @notes <br>
|
|
190
233
|
* - 您可以在使用外部渲染的场景下调用本方法,订阅视频帧的解码数据。
|
|
191
|
-
* - 调用本方法后,会触发 {@link #VeLivePlayerObserver#onRenderVideoFrame
|
|
234
|
+
* - 调用本方法后,会触发 onRenderVideoFrame{@link #VeLivePlayerObserver#onRenderVideoFrame} 回调,回调消息中包含每个视频帧的详细数据。
|
|
192
235
|
* - 如果您使用外部渲染,需要保证音视频同步。
|
|
193
236
|
* @order 14
|
|
194
237
|
* @param enable 是否开启视频帧回调,默认值为 false。 <br>
|
|
@@ -196,7 +239,9 @@ export declare class VeLivePlayer {
|
|
|
196
239
|
* - false:关闭。
|
|
197
240
|
* @param pixelFormat 回调的视频帧像素格式,详情请参见 [VeLivePlayerPixelFormat](188115#VeLivePlayerPixelFormat)。
|
|
198
241
|
* @param bufferType 回调的视频数据封装格式,详情请参见 [VeLivePlayerVideoBufferType](188115#VeLivePlayerVideoBufferType) 。
|
|
242
|
+
*
|
|
199
243
|
*/
|
|
244
|
+
|
|
200
245
|
enableVideoFrameObserver(enable: boolean, pixelFormat: VeLivePlayerPixelFormat, bufferType: VeLivePlayerVideoBufferType): void;
|
|
201
246
|
/** {zh}
|
|
202
247
|
* @detail api
|
|
@@ -209,52 +254,61 @@ export declare class VeLivePlayer {
|
|
|
209
254
|
* - false:关闭。
|
|
210
255
|
* @notes <br>
|
|
211
256
|
* - 您可以在使用外部渲染的场景下调用本方法,订阅音频帧的解码数据。
|
|
212
|
-
* - 调用本方法后,会触发 {@link #VeLivePlayerObserver#onRenderAudioFrame
|
|
257
|
+
* - 调用本方法后,会触发 onRenderAudioFrame{@link #VeLivePlayerObserver#onRenderAudioFrame} 回调,回调消息中包含每个音频帧的详细数据。
|
|
213
258
|
* - 如果您使用外部渲染,需要保证音视频同步。
|
|
214
259
|
* @order 15
|
|
260
|
+
*
|
|
215
261
|
*/
|
|
262
|
+
|
|
216
263
|
enableAudioFrameObserver(enable: boolean, enableRendering: boolean): void;
|
|
217
264
|
/** {zh}
|
|
218
265
|
* @detail api
|
|
219
266
|
* @brief 设置视频顺时针旋转角度。
|
|
220
|
-
* @notes
|
|
267
|
+
* @notes <br>
|
|
221
268
|
* - 支持在播放前和播放中动态修改视频旋转角度。
|
|
222
269
|
* - 每次调用本方法,播放器都将基于图像的原始角度进行旋转。
|
|
223
270
|
* - 当同时使用旋转和镜像功能,播放器会先进行镜像,再进行旋转。
|
|
224
271
|
* @order 16
|
|
225
272
|
* @param rotation 视频旋转角度,默认关闭旋转,详情请参见 [VeLivePlayerRotation](188115#VeLivePlayerRotation) 。
|
|
273
|
+
*
|
|
226
274
|
*/
|
|
275
|
+
|
|
227
276
|
setRenderRotation(rotation: VeLivePlayerRotation): Promise<void>;
|
|
228
277
|
/** {zh}
|
|
229
278
|
* @detail api
|
|
230
279
|
* @brief 设置视频镜像。
|
|
231
|
-
* @notes
|
|
280
|
+
* @notes <br>
|
|
232
281
|
* - 支持在播放前和播放中动态修改视频镜像方式。
|
|
233
282
|
* - 每次调用本方法,播放器都将基于原始图像进行镜像。
|
|
234
283
|
* - 当同时使用旋转和镜像功能,播放器会先进行镜像,再进行旋转。
|
|
235
284
|
* @order 17
|
|
236
285
|
* @param mirror 视频镜像,默认关闭镜像,详情请参见 [VeLivePlayerMirror](188115#VeLivePlayerMirror) 。
|
|
286
|
+
*
|
|
237
287
|
*/
|
|
288
|
+
|
|
238
289
|
setRenderMirror(mirror: VeLivePlayerMirror): Promise<void>;
|
|
239
290
|
/** {zh}
|
|
240
291
|
* @detail api
|
|
241
292
|
* @brief 设置是否开启超分。您需要联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)开通超分功能后才可使用该功能。
|
|
242
|
-
* @notes
|
|
293
|
+
* @notes <br>
|
|
243
294
|
* - 在首帧回调后,调用该接口开启超分。
|
|
244
295
|
* - 支持播放中调用该接口动态开启和关闭超分。
|
|
245
|
-
* - 如果机型、分辨率和帧率不符合限制,将无法开启超分,并触发 {@link #VeLivePlayerObserver#onStreamFailedOpenSuperResolution
|
|
296
|
+
* - 如果机型、分辨率和帧率不符合限制,将无法开启超分,并触发 onStreamFailedOpenSuperResolution{@link #VeLivePlayerObserver#onStreamFailedOpenSuperResolution} 回调。
|
|
246
297
|
* @order 18
|
|
247
298
|
* @param enable 是否开启超分。默认值为 false。<br>
|
|
248
299
|
* - true:开启;
|
|
249
300
|
* - false:关闭。
|
|
301
|
+
*
|
|
250
302
|
*/
|
|
303
|
+
|
|
251
304
|
setEnableSuperResolution(enable: boolean): void;
|
|
252
305
|
/** {zh}
|
|
253
306
|
* @brief 设置是否开启视频锐化。
|
|
254
307
|
* @param enable 是否开启视频锐化,默认值为 `false`。
|
|
255
308
|
* - true:开启;
|
|
256
309
|
* - false:关闭。
|
|
310
|
+
*
|
|
257
311
|
*/
|
|
312
|
+
|
|
258
313
|
setEnableSharpen(enable: boolean): void;
|
|
259
|
-
constructor(context: ApplicationContext);
|
|
260
314
|
}
|
|
@@ -9,6 +9,7 @@ export declare class VeLivePlayerObserver {
|
|
|
9
9
|
* @order 1
|
|
10
10
|
* @param player 触发该事件回调的播放器对象。
|
|
11
11
|
* @param error 错误信息,详情请参见 [VeLivePlayerError](188113#VeLivePlayerError) 。
|
|
12
|
+
*
|
|
12
13
|
*/
|
|
13
14
|
onError?(player: VeLivePlayer, error: VeLivePlayerError): void;
|
|
14
15
|
/** {zh}
|
|
@@ -19,6 +20,7 @@ export declare class VeLivePlayerObserver {
|
|
|
19
20
|
* @param isFirstFrame 渲染成功的是否为视频首帧。<br>
|
|
20
21
|
* - true:视频首帧;
|
|
21
22
|
* - false:重试后第一个视频帧。
|
|
23
|
+
*
|
|
22
24
|
*/
|
|
23
25
|
onFirstVideoFrameRender?(player: VeLivePlayer, isFirstFrame: boolean): void;
|
|
24
26
|
/** {zh}
|
|
@@ -29,6 +31,7 @@ export declare class VeLivePlayerObserver {
|
|
|
29
31
|
* @param isFirstFrame 渲染成功的是否为音频首帧。<br>
|
|
30
32
|
* - true:音频首帧;
|
|
31
33
|
* - false:重试后第一个音频帧。
|
|
34
|
+
*
|
|
32
35
|
*/
|
|
33
36
|
onFirstAudioFrameRender?(player: VeLivePlayer, isFirstFrame: boolean): void;
|
|
34
37
|
/** {zh}
|
|
@@ -36,6 +39,7 @@ export declare class VeLivePlayerObserver {
|
|
|
36
39
|
* @brief 播放卡顿开始回调。
|
|
37
40
|
* @order 4
|
|
38
41
|
* @param player 触发该事件回调的播放器对象。
|
|
42
|
+
*
|
|
39
43
|
*/
|
|
40
44
|
onStallStart?(player: VeLivePlayer): void;
|
|
41
45
|
/** {zh}
|
|
@@ -43,6 +47,7 @@ export declare class VeLivePlayerObserver {
|
|
|
43
47
|
* @brief 播放卡顿结束回调。音频缓冲区达到起播条件且开始播放后,触发此回调。
|
|
44
48
|
* @order 5
|
|
45
49
|
* @param player 触发该事件回调的播放器对象。
|
|
50
|
+
*
|
|
46
51
|
*/
|
|
47
52
|
onStallEnd?(player: VeLivePlayer): void;
|
|
48
53
|
/** {zh}
|
|
@@ -51,6 +56,7 @@ export declare class VeLivePlayerObserver {
|
|
|
51
56
|
* @order 6
|
|
52
57
|
* @param player 触发该事件回调的播放器对象。
|
|
53
58
|
* @param stallTime 视频渲染卡顿时长,单位为 ms。
|
|
59
|
+
*
|
|
54
60
|
*/
|
|
55
61
|
onVideoRenderStall?(player: VeLivePlayer, stallTime: long): void;
|
|
56
62
|
/** {zh}
|
|
@@ -59,6 +65,7 @@ export declare class VeLivePlayerObserver {
|
|
|
59
65
|
* @order 7
|
|
60
66
|
* @param player 触发该事件回调的播放器对象。
|
|
61
67
|
* @param stallTime 音频渲染卡顿时长,单位为 ms。
|
|
68
|
+
*
|
|
62
69
|
*/
|
|
63
70
|
onAudioRenderStall?(player: VeLivePlayer, stallTime: long): void;
|
|
64
71
|
/** {zh}
|
|
@@ -69,6 +76,7 @@ export declare class VeLivePlayerObserver {
|
|
|
69
76
|
* @param resolution 切换后的清晰度档位,详情请参见 [VeLivePlayerResolution](188115#VeLivePlayerResolution) 。
|
|
70
77
|
* @param error 切换清晰度档位时,是否发生错误,详情请参见 [VeLivePlayerError](188113#VeLivePlayerError) 。
|
|
71
78
|
* @param reason 清晰度档位切换的原因,详情请参见 [VeLivePlayerResolutionSwitchReason](188115#VeLivePlayerResolutionSwitchReason) 。
|
|
79
|
+
*
|
|
72
80
|
*/
|
|
73
81
|
onResolutionSwitch?(player: VeLivePlayer, resolution: VeLivePlayerResolution, error: VeLivePlayerError, reason: VeLivePlayerResolutionSwitchReason): void;
|
|
74
82
|
/** {zh}
|
|
@@ -78,6 +86,7 @@ export declare class VeLivePlayerObserver {
|
|
|
78
86
|
* @param player 触发该事件回调的播放器对象。
|
|
79
87
|
* @param width 变化后的视频宽度,单位为 px。
|
|
80
88
|
* @param height 变化后的视频高度,单位为 px。
|
|
89
|
+
*
|
|
81
90
|
*/
|
|
82
91
|
onVideoSizeChanged?(player: VeLivePlayer, width: int, height: int): void;
|
|
83
92
|
/** {zh}
|
|
@@ -86,6 +95,7 @@ export declare class VeLivePlayerObserver {
|
|
|
86
95
|
* @order 10
|
|
87
96
|
* @param player 触发该事件回调的播放器对象。
|
|
88
97
|
* @param message SEI 信息。
|
|
98
|
+
*
|
|
89
99
|
*/
|
|
90
100
|
onReceiveSeiMessage?(player: VeLivePlayer, message: String): void;
|
|
91
101
|
/** {zh}
|
|
@@ -95,6 +105,7 @@ export declare class VeLivePlayerObserver {
|
|
|
95
105
|
* @param player 触发该事件回调的播放器对象。
|
|
96
106
|
* @param streamType 切换后的流类型为主路流或备路流,详情请参见 [VeLivePlayerStreamType](188115#VeLivePlayerStreamType) 。
|
|
97
107
|
* @param error 触发主备流切换的原因,详情请参见 [VeLivePlayerError](188113#VeLivePlayerError) 。
|
|
108
|
+
*
|
|
98
109
|
*/
|
|
99
110
|
onMainBackupSwitch?(player: VeLivePlayer, streamType: VeLivePlayerStreamType, error: VeLivePlayerError): void;
|
|
100
111
|
/** {zh}
|
|
@@ -103,6 +114,7 @@ export declare class VeLivePlayerObserver {
|
|
|
103
114
|
* @order 12
|
|
104
115
|
* @param player 触发该事件回调的播放器对象。
|
|
105
116
|
* @param status 当前播放器的状态,详情请参见 [VeLivePlayerStatus](188115#VeLivePlayerStatus) 。
|
|
117
|
+
*
|
|
106
118
|
*/
|
|
107
119
|
onPlayerStatusUpdate?(player: VeLivePlayer, status: VeLivePlayerStatus): void;
|
|
108
120
|
/** {zh}
|
|
@@ -111,42 +123,47 @@ export declare class VeLivePlayerObserver {
|
|
|
111
123
|
* @order 13
|
|
112
124
|
* @param player 触发该事件回调的播放器对象。
|
|
113
125
|
* @param statistics 播放器周期性回调的统计信息,详情请参见 [VeLivePlayerStatistics](188115#VeLivePlayerStatistics) 。
|
|
126
|
+
*
|
|
114
127
|
*/
|
|
115
128
|
onStatistics?(player: VeLivePlayer, statistics: VeLivePlayerStatistics): void;
|
|
116
129
|
/** {zh}
|
|
117
130
|
* @detail callback
|
|
118
|
-
* @brief 截图成功回调。当播放器调用 {@link #VeLivePlayer#snapshot
|
|
131
|
+
* @brief 截图成功回调。当播放器调用 snapshot{@link #VeLivePlayer#snapshot} 截图成功后,会触发此回调。
|
|
119
132
|
* @order 14
|
|
120
133
|
* @param player 触发该事件回调的播放器对象。
|
|
121
134
|
* @param bitmap 截图的 Bitmap 对象。
|
|
135
|
+
*
|
|
122
136
|
*/
|
|
123
137
|
onSnapshotComplete?(player: VeLivePlayer, bitmap: Bitmap): void;
|
|
124
138
|
/** {zh}
|
|
125
139
|
* @detail callback
|
|
126
|
-
* @brief 视频帧回调。调用 {@link #VeLivePlayer#enableVideoFrameObserver
|
|
140
|
+
* @brief 视频帧回调。调用 enableVideoFrameObserver{@link #VeLivePlayer#enableVideoFrameObserver} 开启视频帧解析回调后,当播放器成功解码视频帧时,会触发此回调。
|
|
127
141
|
* @notes <br>
|
|
128
142
|
* 如果自定义渲染使用纹理格式,建议在视频帧回调线程中执行渲染操作。
|
|
129
143
|
* @order 15
|
|
130
144
|
* @param player 触发该事件回调的播放器对象。
|
|
131
145
|
* @param videoFrame 视频帧数据,包含像素格式、封装格式、视频宽高等信息,详情请参见 [VeLivePlayerVideoFrame](188115#VeLivePlayerVideoFrame) 。
|
|
146
|
+
*
|
|
132
147
|
*/
|
|
133
148
|
onRenderVideoFrame?(player: VeLivePlayer, videoFrame: VeLivePlayerVideoFrame): void;
|
|
134
149
|
/** {zh}
|
|
135
150
|
* @detail callback
|
|
136
|
-
* @brief 音频帧回调。调用 {@link #VeLivePlayer#enableAudioFrameObserver
|
|
151
|
+
* @brief 音频帧回调。调用 enableAudioFrameObserver{@link #VeLivePlayer#enableAudioFrameObserver} 开启音频帧解析回调后,当播放器成功解码音频帧时,会触发此回调。
|
|
137
152
|
* @notes <br>
|
|
138
153
|
* 回调的音频帧数据为 float32 格式,大端字节序存储。
|
|
139
154
|
* @order 16
|
|
140
155
|
* @param player 触发该事件回调的播放器对象。
|
|
141
156
|
* @param audioFrame 音频数据,详情请参见 [VeLivePlayerAudioFrame](188115#VeLivePlayerAudioFrame) 。
|
|
157
|
+
*
|
|
142
158
|
*/
|
|
143
159
|
onRenderAudioFrame?(player: VeLivePlayer, audioFrame: VeLivePlayerAudioFrame): void;
|
|
144
160
|
/** {zh}
|
|
145
161
|
* @detail callback
|
|
146
|
-
* @brief 超分开启失败。调用 {@link #VeLivePlayer#setEnableSuperResolution
|
|
162
|
+
* @brief 超分开启失败。调用 setEnableSuperResolution{@link #VeLivePlayer#setEnableSuperResolution} 开启超分后,当播放器不支持超分开启或者超分处理出错时,会触发此回调。
|
|
147
163
|
* @order 17
|
|
148
164
|
* @param player 触发该事件回调的播放器对象。
|
|
149
165
|
* @param error 超分开启失败原因,错误码请参见 [VeLivePlayerErrorCode](188113#VeLivePlayerError-VeLivePlayerErrorCode) 。
|
|
166
|
+
*
|
|
150
167
|
*/
|
|
151
168
|
onStreamFailedOpenSuperResolution?(player: VeLivePlayer, error: VeLivePlayerError): void;
|
|
152
169
|
}
|
|
@@ -1,99 +1,122 @@
|
|
|
1
1
|
import { int, String } from './types';
|
|
2
2
|
export declare class VeLivePlayerError {
|
|
3
|
+
constructor(errorCode: int, errorMsg: String);
|
|
4
|
+
constructor(errorCode: int);
|
|
3
5
|
/** {zh}
|
|
4
6
|
* @brief 直播播放错误码。
|
|
7
|
+
*
|
|
5
8
|
*/
|
|
6
9
|
mErrorCode: int;
|
|
7
10
|
/** {zh}
|
|
8
11
|
* @brief 直播播放错误信息。
|
|
12
|
+
*
|
|
9
13
|
*/
|
|
10
14
|
mErrorMsg: String;
|
|
11
|
-
static new_VeLivePlayerError_int(errorCode: int): VeLivePlayerError;
|
|
12
|
-
static new_VeLivePlayerError_int$String(errorCode: int, errorMsg: String): VeLivePlayerError;
|
|
13
15
|
}
|
|
14
16
|
export declare enum VeLivePlayerErrorCode {
|
|
15
17
|
/** {zh}
|
|
16
18
|
* @brief 没有错误。
|
|
19
|
+
*
|
|
17
20
|
*/
|
|
18
21
|
VeLivePlayerNoError = 0,
|
|
19
22
|
/** {zh}
|
|
20
23
|
* @brief License 无效。可能 License 集成错误或 License 过期,请检查 License 集成方式和有效性。
|
|
24
|
+
*
|
|
21
25
|
*/
|
|
22
26
|
VeLivePlayerInvalidLicense = -1,
|
|
23
27
|
/** {zh}
|
|
24
28
|
* @brief 调用时传入的参数不合法。请检查入参,并重新调用。
|
|
29
|
+
*
|
|
25
30
|
*/
|
|
26
31
|
VeLivePlayerInvalidParameter = -2,
|
|
27
32
|
/** {zh}
|
|
28
33
|
* @brief 调用被拒绝。方法调用时机不合法,请检查调用时机。
|
|
34
|
+
*
|
|
29
35
|
*/
|
|
30
36
|
VeLivePlayerErrorRefused = -3,
|
|
31
37
|
/** {zh}
|
|
32
38
|
* @brief 加载库文件失败。可能是 SDK 集成错误,请检查 SDK 集成方式。
|
|
39
|
+
*
|
|
33
40
|
*/
|
|
34
41
|
VeLivePlayerErrorLibraryLoadFailed = -4,
|
|
35
42
|
/** {zh}
|
|
36
43
|
* @brief 播放地址不存在或无效。可能是播放地址为空、地址格式不合法或地址长度不合法,请检查播放地址。
|
|
44
|
+
*
|
|
37
45
|
*/
|
|
38
46
|
VeLivePlayerErrorPlayUrl = -100,
|
|
39
47
|
/** {zh}
|
|
40
48
|
* @brief 无法获取流数据。可能是直播流不存在、直播流中断或直播已结束,请检查直播状态。
|
|
49
|
+
*
|
|
41
50
|
*/
|
|
42
51
|
VeLivePlayerErrorNoStreamData = -101,
|
|
43
52
|
/** {zh}
|
|
44
53
|
* @brief 内部播放重试。可能由于播放器内部错误触发了重试。
|
|
54
|
+
*
|
|
45
55
|
*/
|
|
46
56
|
VeLivePlayerErrorInternalRetryStart = -102,
|
|
47
57
|
/** {zh}
|
|
48
58
|
* @brief 内部重试失败。内部重试次数达到最大限制,播放器停止重试,您可以尝试重新播放。
|
|
59
|
+
*
|
|
49
60
|
*/
|
|
50
61
|
VeLivePlayerErrorInternalRetryFailed = -103,
|
|
51
62
|
/** {zh}
|
|
52
63
|
* @brief DNS 解析失败。可能是播放地址异常或客户端网络异常,请您检查播放地址和网络情况,如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
64
|
+
*
|
|
53
65
|
*/
|
|
54
66
|
VeLivePlayerErrorDnsParseFailed = -200,
|
|
55
67
|
/** {zh}
|
|
56
68
|
* @brief 网络请求失败。请检查网络情况,如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
69
|
+
*
|
|
57
70
|
*/
|
|
58
71
|
VeLivePlayerErrorNetworkRequestFailed = -201,
|
|
59
72
|
/** {zh}
|
|
60
73
|
* @brief 直播格式解封装失败。可能是使用了不支持的直播流格式和协议,或音视频流错误;请检查流格式,如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
74
|
+
*
|
|
61
75
|
*/
|
|
62
76
|
VeLivePlayerErrorDemuxFailed = -300,
|
|
63
77
|
/** {zh}
|
|
64
78
|
* @brief 视频解码失败。可能使用了不支持的直播流音视频格式,或解码器出错;请检查音视频格式,如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
79
|
+
*
|
|
65
80
|
*/
|
|
66
81
|
VeLivePlayerErrorDecodeFailed = -301,
|
|
67
82
|
/** {zh}
|
|
68
83
|
* @brief 渲染失败。可能是音视频输出设备异常,请重试;如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
84
|
+
*
|
|
69
85
|
*/
|
|
70
86
|
VeLivePlayerErrorAVOutputFailed = -302,
|
|
71
87
|
/** {zh}
|
|
72
88
|
* @brief 该台设备不支持超分能力,不在超分机型白名单内;如果有疑问,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
89
|
+
*
|
|
73
90
|
*/
|
|
74
91
|
VeLivePlayerErrorSRDeviceUnsupported = -303,
|
|
75
92
|
/** {zh}
|
|
76
93
|
* @brief 当前分辨率高于超分开启限制的最大分辨率。如果有疑问,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
94
|
+
*
|
|
77
95
|
*/
|
|
78
96
|
VeLivePlayerErrorSRResolutionUnsupported = -304,
|
|
79
97
|
/** {zh}
|
|
80
98
|
* @brief 当前帧率高于超分开启限制的最大帧率。如果有疑问,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
99
|
+
*
|
|
81
100
|
*/
|
|
82
101
|
VeLivePlayerErrorSRFpsUnsupported = -305,
|
|
83
102
|
/** {zh}
|
|
84
103
|
* @brief 超分初始化失败。可能超分参数配置错误,或版本不兼容;如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
104
|
+
*
|
|
85
105
|
*/
|
|
86
106
|
VeLivePlayerErrorSRInitFail = -306,
|
|
87
107
|
/** {zh}
|
|
88
108
|
* @brief 超分执行失败,可能超分参数配置错误,或版本不兼容;如果故障未排除,请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
109
|
+
*
|
|
89
110
|
*/
|
|
90
111
|
VeLivePlayerErrorSRExecuteFail = -307,
|
|
91
112
|
/** {zh}
|
|
92
113
|
* @brief 您使用的基础版 License 暂不支持 H.265 硬件解码,请登录火山引擎[视频直播控制台](https://console.volcengine.com/live/main/sdk)获取高级版 License。
|
|
114
|
+
*
|
|
93
115
|
*/
|
|
94
116
|
VeLivePlayerLicenseUnsupportedH265 = -308,
|
|
95
117
|
/** {zh}
|
|
96
118
|
* @brief 内部错误。请联系火山引擎[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
119
|
+
*
|
|
97
120
|
*/
|
|
98
121
|
VeLivePlayerErrorInternal = -999
|
|
99
122
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ApplicationContext } from '../../platforms/android/extends';
|