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