@byteplus/veplayer 1.18.0 → 1.19.0-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.
- package/index.d.ts +1141 -266
- package/index.min.css +1 -1
- package/index.min.js +2 -2
- package/lite.cjs +2 -2
- package/lite.cjs.css +1 -1
- package/lite.d.ts +637 -0
- package/lite.esm.css +1 -1
- package/lite.esm.mjs +2 -2
- package/lite.min.css +1 -1
- package/lite.min.js +2 -2
- package/package.json +1 -1
- package/plugin/hlsEncrypt.js +2 -2
- package/plugin/hlsjs.js +1 -1
- package/plugin/hlsjsPro.js +2 -2
- package/plugin/modules/DashAbralgo.mjs +1 -1
- package/plugin/modules/XGVideo.mjs +1 -1
- package/plugin/modules/danmuMask.mjs +1 -1
- package/plugin/modules/danmujs.mjs +1 -1
- package/plugin/modules/dash.mjs +1 -1
- package/plugin/modules/flv.mjs +1 -1
- package/plugin/modules/hls.mjs +1 -1
- package/plugin/modules/hlsEncrypt.mjs +2 -2
- package/plugin/modules/hlsjs.mjs +2 -2
- package/plugin/modules/hlsjsPro.mjs +2 -2
- package/plugin/modules/mp4Encrypt.mjs +1 -1
- package/plugin/modules/preloader.mjs +1 -1
- package/plugin/modules/streamprobe.mjs +1 -1
- package/plugin/modules/vestrategy.mjs +1 -1
- package/plugin/modules/vestrategy_adapt_range.mjs +1 -1
- package/plugin/modules/vestrategy_h265.mjs +1 -1
- package/plugin/modules/vestrategy_preload.mjs +1 -1
- package/plugin/xgHls.js +1 -1
package/lite.d.ts
CHANGED
|
@@ -22,6 +22,629 @@ export declare enum UmdKeys {
|
|
|
22
22
|
}
|
|
23
23
|
/** Resolved UMD module values keyed by their public UMD key. */
|
|
24
24
|
export type UmdModules = Partial<Record<UmdKeys, unknown>>;
|
|
25
|
+
interface ISubTitleItem {
|
|
26
|
+
/** {zh}
|
|
27
|
+
* @brief 字幕来源。业务配置字幕为 `config`,Master M3U8 或原生 HLS 字幕为 `hls`。
|
|
28
|
+
* @default config
|
|
29
|
+
*/
|
|
30
|
+
/** {en}
|
|
31
|
+
* @brief Subtitle source. Business-configured subtitles use `config`; Master M3U8 or native HLS subtitles use `hls`.
|
|
32
|
+
* @default config
|
|
33
|
+
*/
|
|
34
|
+
source?: "config" | "hls";
|
|
35
|
+
/** {zh}
|
|
36
|
+
* @brief 字幕语言。
|
|
37
|
+
* @default -
|
|
38
|
+
*/
|
|
39
|
+
/** {en}
|
|
40
|
+
* @brief Subtitle language.
|
|
41
|
+
* @default -
|
|
42
|
+
*/
|
|
43
|
+
language?: string | number;
|
|
44
|
+
/** {zh}
|
|
45
|
+
* @brief 字幕 ID。
|
|
46
|
+
* @default -
|
|
47
|
+
*/
|
|
48
|
+
/** {en}
|
|
49
|
+
* @brief Subtitle ID.
|
|
50
|
+
* @default -
|
|
51
|
+
*/
|
|
52
|
+
id?: number | string;
|
|
53
|
+
/** {zh}
|
|
54
|
+
* @brief 是否为默认选择的字幕。
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
/** {en}
|
|
58
|
+
* @brief Whether this is the default selected subtitle.
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
isDefault?: boolean;
|
|
62
|
+
/** {zh}
|
|
63
|
+
* @brief 是否为强制字幕轨。
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
/** {en}
|
|
67
|
+
* @brief Whether the subtitle track is forced.
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
forced?: boolean;
|
|
71
|
+
/** {zh}
|
|
72
|
+
* @brief HLS 字幕轨的特征标识,例如无障碍字幕特征;未声明时为空。
|
|
73
|
+
* @default -
|
|
74
|
+
*/
|
|
75
|
+
/** {en}
|
|
76
|
+
* @brief HLS subtitle-track characteristics, such as accessibility traits; absent when not declared.
|
|
77
|
+
* @default -
|
|
78
|
+
*/
|
|
79
|
+
characteristics?: string;
|
|
80
|
+
/** {zh}
|
|
81
|
+
* @brief 字幕名称。
|
|
82
|
+
* @default -
|
|
83
|
+
*/
|
|
84
|
+
/** {en}
|
|
85
|
+
* @brief Subtitle display name.
|
|
86
|
+
* @default -
|
|
87
|
+
*/
|
|
88
|
+
text?: string;
|
|
89
|
+
/** {zh}
|
|
90
|
+
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
91
|
+
* @default -
|
|
92
|
+
*/
|
|
93
|
+
/** {en}
|
|
94
|
+
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
95
|
+
* @default -
|
|
96
|
+
*/
|
|
97
|
+
label?: string | number;
|
|
98
|
+
/** {zh}
|
|
99
|
+
* @brief 外挂字幕 URL 地址。
|
|
100
|
+
* @default -
|
|
101
|
+
*/
|
|
102
|
+
/** {en}
|
|
103
|
+
* @brief External subtitle URL.
|
|
104
|
+
* @default -
|
|
105
|
+
*/
|
|
106
|
+
url?: string;
|
|
107
|
+
/**
|
|
108
|
+
* @hidden
|
|
109
|
+
* @type {string}
|
|
110
|
+
* @memberof ISubTitleItem
|
|
111
|
+
*/
|
|
112
|
+
stringContent?: string;
|
|
113
|
+
/** {zh}
|
|
114
|
+
* @brief 字幕内容列表。非 `url` 形式时使用。
|
|
115
|
+
* @default -
|
|
116
|
+
* @type {Array<Object>}
|
|
117
|
+
* @memberof ISubTitleItem
|
|
118
|
+
*/
|
|
119
|
+
/** {en}
|
|
120
|
+
* @brief Subtitle content list when not using URL.
|
|
121
|
+
* @default -
|
|
122
|
+
* @type {Array<Object>}
|
|
123
|
+
* @memberof ISubTitleItem
|
|
124
|
+
*/
|
|
125
|
+
list?: IListItem[];
|
|
126
|
+
}
|
|
127
|
+
interface IListItem {
|
|
128
|
+
/** {zh}
|
|
129
|
+
* @brief 开始时间,单位为秒。
|
|
130
|
+
* @type {number}
|
|
131
|
+
*/
|
|
132
|
+
/** {en}
|
|
133
|
+
* @brief Start time in seconds.
|
|
134
|
+
* @type {number}
|
|
135
|
+
*/
|
|
136
|
+
start: number;
|
|
137
|
+
/** {zh}
|
|
138
|
+
* @brief 结束时间,单位为秒。
|
|
139
|
+
* @type {number}
|
|
140
|
+
*/
|
|
141
|
+
/** {en}
|
|
142
|
+
* @brief End time in seconds.
|
|
143
|
+
* @type {number}
|
|
144
|
+
*/
|
|
145
|
+
end: number;
|
|
146
|
+
/** {zh}
|
|
147
|
+
* @brief 字幕数据列表。
|
|
148
|
+
* @type {Array<ITextItem>}
|
|
149
|
+
*/
|
|
150
|
+
/** {en}
|
|
151
|
+
* @brief Subtitle cue data list.
|
|
152
|
+
* @type {Array<ITextItem>}
|
|
153
|
+
*/
|
|
154
|
+
list: Array<ITextItem>;
|
|
155
|
+
/**
|
|
156
|
+
* @hidden
|
|
157
|
+
* @type {any}
|
|
158
|
+
*/
|
|
159
|
+
[propName: string]: any;
|
|
160
|
+
}
|
|
161
|
+
interface ITextItem {
|
|
162
|
+
/**
|
|
163
|
+
* @hidden
|
|
164
|
+
* @type {any}
|
|
165
|
+
*/
|
|
166
|
+
[propName: string]: any;
|
|
167
|
+
/** {zh}
|
|
168
|
+
* @brief 开始时间,单位为秒。
|
|
169
|
+
* @type {number}
|
|
170
|
+
*/
|
|
171
|
+
/** {en}
|
|
172
|
+
* @brief Start time in seconds.
|
|
173
|
+
* @type {number}
|
|
174
|
+
*/
|
|
175
|
+
start: number;
|
|
176
|
+
/** {zh}
|
|
177
|
+
* @brief 结束时间,单位为秒。
|
|
178
|
+
* @type {number}
|
|
179
|
+
*/
|
|
180
|
+
/** {en}
|
|
181
|
+
* @brief End time in seconds.
|
|
182
|
+
* @type {number}
|
|
183
|
+
*/
|
|
184
|
+
end: number;
|
|
185
|
+
/** {zh}
|
|
186
|
+
* @brief 字幕文案数组。
|
|
187
|
+
* @type {string[]}
|
|
188
|
+
*/
|
|
189
|
+
/** {en}
|
|
190
|
+
* @brief Subtitle text array.
|
|
191
|
+
* @type {string[]}
|
|
192
|
+
*/
|
|
193
|
+
text: string[];
|
|
194
|
+
/** {zh}
|
|
195
|
+
* @brief 字幕顺序。
|
|
196
|
+
* @type {number}
|
|
197
|
+
*/
|
|
198
|
+
/** {en}
|
|
199
|
+
* @brief Subtitle display order.
|
|
200
|
+
* @type {number}
|
|
201
|
+
*/
|
|
202
|
+
index?: number;
|
|
203
|
+
}
|
|
204
|
+
/** {zh}
|
|
205
|
+
* @brief VePlayer 实际使用的 HLS 播放内核。
|
|
206
|
+
* @detail ref
|
|
207
|
+
*/
|
|
208
|
+
/** {en}
|
|
209
|
+
* @brief The HLS playback engine actually used by VePlayer.
|
|
210
|
+
* @detail ref
|
|
211
|
+
*/
|
|
212
|
+
export type HlsPlaybackEngine = "hlsjs" | "veplayer-hls" | "native" | "none";
|
|
213
|
+
/** {zh}
|
|
214
|
+
* @brief HLS 自动码率决策引擎配置值。
|
|
215
|
+
* @detail ref
|
|
216
|
+
*/
|
|
217
|
+
/** {en}
|
|
218
|
+
* @brief Configurable HLS adaptive-bitrate decision engine.
|
|
219
|
+
* @detail ref
|
|
220
|
+
*/
|
|
221
|
+
export type HlsAbrEngine = "hlsjs" | "veplayer";
|
|
222
|
+
/** {zh}
|
|
223
|
+
* @brief 当前播放会话最终解析出的自动码率决策引擎。
|
|
224
|
+
* @detail ref
|
|
225
|
+
*/
|
|
226
|
+
/** {en}
|
|
227
|
+
* @brief Adaptive-bitrate decision engine resolved for the current playback session.
|
|
228
|
+
* @detail ref
|
|
229
|
+
*/
|
|
230
|
+
export type ResolvedAbrEngine = HlsAbrEngine | "native" | "none";
|
|
231
|
+
/** {zh}
|
|
232
|
+
* @brief HLS 自动码率控制模式。
|
|
233
|
+
* @detail ref
|
|
234
|
+
*/
|
|
235
|
+
/** {en}
|
|
236
|
+
* @brief HLS adaptive-bitrate control mode.
|
|
237
|
+
* @detail ref
|
|
238
|
+
*/
|
|
239
|
+
export type HlsAbrMode = "auto" | "manual";
|
|
240
|
+
/** {zh}
|
|
241
|
+
* @brief 当前播放会话无法使用 HLS ABR 的原因。
|
|
242
|
+
* @detail ref
|
|
243
|
+
*/
|
|
244
|
+
/** {en}
|
|
245
|
+
* @brief Reason why HLS ABR is unavailable for the current playback session.
|
|
246
|
+
* @detail ref
|
|
247
|
+
*/
|
|
248
|
+
export type HlsAbrUnavailableReason = "NOT_HLS" | "NOT_HLSJS_ENGINE" | "MANIFEST_NOT_READY" | "MULTI_LEVEL_MASTER_REQUIRED" | "DEFINITION_LIST_REQUIRED" | "ABR_MODULE_UNAVAILABLE" | "ABR_RUNTIME_UNAVAILABLE" | "LICENSE_UNAVAILABLE" | "NO_ABR_VARIANTS";
|
|
249
|
+
/** {zh}
|
|
250
|
+
* @brief 当前 HLS 播放会话支持的 ABR 能力。
|
|
251
|
+
* @detail ref
|
|
252
|
+
*/
|
|
253
|
+
/** {en}
|
|
254
|
+
* @brief ABR capabilities supported by the current HLS playback session.
|
|
255
|
+
* @detail ref
|
|
256
|
+
*/
|
|
257
|
+
export interface IHlsAbrCapabilities {
|
|
258
|
+
/** {zh} @brief 是否可读取 HLS Level 列表。 */
|
|
259
|
+
/** {en} @brief Whether the HLS Level list is available. */
|
|
260
|
+
levelList: boolean;
|
|
261
|
+
/** {zh} @brief 是否支持手动切换 HLS Level。 */
|
|
262
|
+
/** {en} @brief Whether manual HLS Level switching is supported. */
|
|
263
|
+
manualLevelSwitch: boolean;
|
|
264
|
+
/** {zh} @brief 是否支持恢复当前 ABR 引擎的自动模式。 */
|
|
265
|
+
/** {en} @brief Whether automatic mode can be restored for the resolved ABR engine. */
|
|
266
|
+
restoreAuto: boolean;
|
|
267
|
+
/** {zh} @brief 是否支持按 Level 设置自动码率上限。 */
|
|
268
|
+
/** {en} @brief Whether an automatic bitrate cap can be set by Level. */
|
|
269
|
+
levelCap: boolean;
|
|
270
|
+
/** {zh} @brief 是否支持按码率设置自动码率上限。 */
|
|
271
|
+
/** {en} @brief Whether an automatic bitrate cap can be set by bitrate. */
|
|
272
|
+
bitrateCap: boolean;
|
|
273
|
+
/** {zh} @brief 是否支持按 VePlayer 清晰度设置自动码率上限。 */
|
|
274
|
+
/** {en} @brief Whether an automatic bitrate cap can be set by VePlayer definition. */
|
|
275
|
+
definitionCap: boolean;
|
|
276
|
+
}
|
|
277
|
+
/** {zh}
|
|
278
|
+
* @brief 当前播放会话的 HLS ABR 状态快照。
|
|
279
|
+
* @detail ref
|
|
280
|
+
*/
|
|
281
|
+
/** {en}
|
|
282
|
+
* @brief HLS ABR state snapshot for the current playback session.
|
|
283
|
+
* @detail ref
|
|
284
|
+
*/
|
|
285
|
+
export interface IHlsAbrState {
|
|
286
|
+
/** {zh} @brief 播放会话 ID,用于识别过期状态和事件。 */
|
|
287
|
+
/** {en} @brief Playback session ID used to reject stale state and events. */
|
|
288
|
+
playbackSessionId: string;
|
|
289
|
+
/** {zh} @brief VePlayer 实际使用的 HLS 播放内核。 */
|
|
290
|
+
/** {en} @brief HLS playback engine actually used by VePlayer. */
|
|
291
|
+
playbackEngine: HlsPlaybackEngine;
|
|
292
|
+
/** {zh} @brief 业务显式配置的 ABR 引擎;未配置时为 `null`。 */
|
|
293
|
+
/** {en} @brief Explicitly configured ABR engine, or `null` when omitted. */
|
|
294
|
+
configuredEngine: HlsAbrEngine | null;
|
|
295
|
+
/** {zh} @brief 当前播放会话最终解析出的 ABR 决策引擎。 */
|
|
296
|
+
/** {en} @brief ABR decision engine resolved for the current playback session. */
|
|
297
|
+
engine: ResolvedAbrEngine;
|
|
298
|
+
/** {zh} @brief 当前清晰度决策使用的数据源。 */
|
|
299
|
+
/** {en} @brief Data source used for the current rendition decision. */
|
|
300
|
+
decisionSource: "hls-levels" | "definition-list" | "native" | "none";
|
|
301
|
+
/** {zh} @brief 当前播放会话是否具备所选 ABR 引擎所需条件。 */
|
|
302
|
+
/** {en} @brief Whether the selected ABR engine is available in the current session. */
|
|
303
|
+
available: boolean;
|
|
304
|
+
/** {zh} @brief 当前 ABR 决策引擎是否正在自动选档。 */
|
|
305
|
+
/** {en} @brief Whether the resolved ABR engine is actively selecting renditions. */
|
|
306
|
+
active: boolean;
|
|
307
|
+
/** {zh} @brief 当前为自动模式还是手动模式。 */
|
|
308
|
+
/** {en} @brief Whether the current mode is automatic or manual. */
|
|
309
|
+
mode: HlsAbrMode;
|
|
310
|
+
/** {zh} @brief hls.js 当前实际播放的 Level 索引。 */
|
|
311
|
+
/** {en} @brief Current hls.js Level index being rendered. */
|
|
312
|
+
currentLevel?: number;
|
|
313
|
+
/** {zh} @brief VePlayer ABR 当前实际播放的清晰度。 */
|
|
314
|
+
/** {en} @brief Current definition rendered by VePlayer ABR. */
|
|
315
|
+
currentDefinition?: string;
|
|
316
|
+
/** {zh} @brief ABR 不可用时的稳定原因码。 */
|
|
317
|
+
/** {en} @brief Stable reason code when ABR is unavailable. */
|
|
318
|
+
reason?: HlsAbrUnavailableReason;
|
|
319
|
+
/** {zh} @brief 当前播放会话支持的 ABR 控制能力。 */
|
|
320
|
+
/** {en} @brief ABR control capabilities supported by the current session. */
|
|
321
|
+
capabilities: IHlsAbrCapabilities;
|
|
322
|
+
}
|
|
323
|
+
/** {zh}
|
|
324
|
+
* @brief HLS ABR 上限;`null` 表示清除上限。
|
|
325
|
+
* @detail ref
|
|
326
|
+
*/
|
|
327
|
+
/** {en}
|
|
328
|
+
* @brief HLS ABR limit; `null` clears the active limit.
|
|
329
|
+
* @detail ref
|
|
330
|
+
*/
|
|
331
|
+
export type IHlsAbrLimit = {
|
|
332
|
+
type: "level";
|
|
333
|
+
maxLevel: number;
|
|
334
|
+
} | {
|
|
335
|
+
type: "bitrate";
|
|
336
|
+
maxBitrate: number;
|
|
337
|
+
} | {
|
|
338
|
+
type: "definition";
|
|
339
|
+
maxDefinition: string;
|
|
340
|
+
} | null;
|
|
341
|
+
/** {zh}
|
|
342
|
+
* @brief `HLS_ABR_ENGINE_RESOLVED` 事件数据。
|
|
343
|
+
* @detail ref
|
|
344
|
+
*/
|
|
345
|
+
/** {en}
|
|
346
|
+
* @brief Payload of the `HLS_ABR_ENGINE_RESOLVED` event.
|
|
347
|
+
* @detail ref
|
|
348
|
+
*/
|
|
349
|
+
export interface IHlsAbrEngineResolvedEvent extends IHlsAbrState {
|
|
350
|
+
}
|
|
351
|
+
/** {zh}
|
|
352
|
+
* @brief `HLS_ABR_STATE_CHANGE` 事件数据。
|
|
353
|
+
* @detail ref
|
|
354
|
+
*/
|
|
355
|
+
/** {en}
|
|
356
|
+
* @brief Payload of the `HLS_ABR_STATE_CHANGE` event.
|
|
357
|
+
* @detail ref
|
|
358
|
+
*/
|
|
359
|
+
export interface IHlsAbrStateChangeEvent extends IHlsAbrState {
|
|
360
|
+
}
|
|
361
|
+
/** {zh}
|
|
362
|
+
* @brief `HLS_ABR_LIMIT_CHANGE` 事件数据。
|
|
363
|
+
* @detail ref
|
|
364
|
+
*/
|
|
365
|
+
/** {en}
|
|
366
|
+
* @brief Payload of the `HLS_ABR_LIMIT_CHANGE` event.
|
|
367
|
+
* @detail ref
|
|
368
|
+
*/
|
|
369
|
+
export interface IHlsAbrLimitChangeEvent {
|
|
370
|
+
/** {zh} @brief 事件所属的播放会话 ID。 */
|
|
371
|
+
/** {en} @brief Playback session ID that owns the event. */
|
|
372
|
+
playbackSessionId: string;
|
|
373
|
+
/** {zh} @brief 当前播放会话最终解析出的 ABR 决策引擎。 */
|
|
374
|
+
/** {en} @brief ABR decision engine resolved for the current playback session. */
|
|
375
|
+
engine: ResolvedAbrEngine;
|
|
376
|
+
/** {zh} @brief 已生效的 ABR 上限;`null` 表示上限已清除。 */
|
|
377
|
+
/** {en} @brief Applied ABR limit, or `null` when the limit has been cleared. */
|
|
378
|
+
limit: IHlsAbrLimit;
|
|
379
|
+
}
|
|
380
|
+
/** {zh}
|
|
381
|
+
* @brief Master M3U8 中一个标准化的 HLS Level;`index` 仅在当前播放会话内有效。
|
|
382
|
+
* @detail ref
|
|
383
|
+
*/
|
|
384
|
+
/** {en}
|
|
385
|
+
* @brief A normalized HLS Level from a Master M3U8; `index` is valid only in the current playback session.
|
|
386
|
+
* @detail ref
|
|
387
|
+
*/
|
|
388
|
+
export interface IHlsLevel {
|
|
389
|
+
/** {zh} @brief 当前播放会话内的 Level 索引。 */
|
|
390
|
+
/** {en} @brief Level index within the current playback session. */
|
|
391
|
+
index: number;
|
|
392
|
+
/** {zh} @brief 峰值码率,单位为 bit/s。 */
|
|
393
|
+
/** {en} @brief Peak bitrate in bits per second. */
|
|
394
|
+
bitrate: number;
|
|
395
|
+
/** {zh} @brief 平均码率,单位为 bit/s。 */
|
|
396
|
+
/** {en} @brief Average bitrate in bits per second. */
|
|
397
|
+
averageBitrate?: number;
|
|
398
|
+
/** {zh} @brief 视频宽度,单位为像素。 */
|
|
399
|
+
/** {en} @brief Video width in pixels. */
|
|
400
|
+
width?: number;
|
|
401
|
+
/** {zh} @brief 视频高度,单位为像素。 */
|
|
402
|
+
/** {en} @brief Video height in pixels. */
|
|
403
|
+
height?: number;
|
|
404
|
+
/** {zh} @brief 视频帧率。 */
|
|
405
|
+
/** {en} @brief Video frame rate. */
|
|
406
|
+
frameRate?: number;
|
|
407
|
+
/** {zh} @brief 视频编码标识。 */
|
|
408
|
+
/** {en} @brief Video codec identifier. */
|
|
409
|
+
videoCodec?: string;
|
|
410
|
+
/** {zh} @brief 音频编码标识。 */
|
|
411
|
+
/** {en} @brief Audio codec identifier. */
|
|
412
|
+
audioCodec?: string;
|
|
413
|
+
/** {zh} @brief 视频动态范围标识。 */
|
|
414
|
+
/** {en} @brief Video dynamic-range identifier. */
|
|
415
|
+
videoRange?: string;
|
|
416
|
+
/** {zh} @brief Manifest 声明的 Level 名称。 */
|
|
417
|
+
/** {en} @brief Level name declared by the manifest. */
|
|
418
|
+
name?: string;
|
|
419
|
+
}
|
|
420
|
+
/** {zh}
|
|
421
|
+
* @brief 当前播放会话的 HLS Level 状态快照。
|
|
422
|
+
* @detail ref
|
|
423
|
+
*/
|
|
424
|
+
/** {en}
|
|
425
|
+
* @brief HLS Level state snapshot for the current playback session.
|
|
426
|
+
* @detail ref
|
|
427
|
+
*/
|
|
428
|
+
export interface IHlsLevelState {
|
|
429
|
+
/** {zh} @brief 播放会话 ID,用于识别过期状态和事件。 */
|
|
430
|
+
/** {en} @brief Playback session ID used to reject stale state and events. */
|
|
431
|
+
playbackSessionId: string;
|
|
432
|
+
/** {zh} @brief Level 列表是否已就绪。 */
|
|
433
|
+
/** {en} @brief Whether the Level list is ready. */
|
|
434
|
+
ready: boolean;
|
|
435
|
+
/** {zh} @brief 当前播放会话内的标准化 Level 列表。 */
|
|
436
|
+
/** {en} @brief Normalized Level list for the current playback session. */
|
|
437
|
+
levels: IHlsLevel[];
|
|
438
|
+
/** {zh} @brief 当前实际播放的 Level 索引,未知时为 `-1`。 */
|
|
439
|
+
/** {en} @brief Currently rendered Level index, or `-1` when unknown. */
|
|
440
|
+
currentLevel: number;
|
|
441
|
+
/** {zh} @brief 当前加载的 Level 索引,未知时为 `-1`。 */
|
|
442
|
+
/** {en} @brief Currently loaded Level index, or `-1` when unknown. */
|
|
443
|
+
loadLevel: number;
|
|
444
|
+
/** {zh} @brief 下一个分片使用的 Level 索引,未知时为 `-1`。 */
|
|
445
|
+
/** {en} @brief Level index for the next fragment, or `-1` when unknown. */
|
|
446
|
+
nextLevel: number;
|
|
447
|
+
/** {zh} @brief 手动 Level 索引;自动模式下为 `-1`。 */
|
|
448
|
+
/** {en} @brief Manual Level index; `-1` in automatic mode. */
|
|
449
|
+
manualLevel: number;
|
|
450
|
+
/** {zh} @brief hls.js 是否处于自动选档模式。 */
|
|
451
|
+
/** {en} @brief Whether hls.js automatic Level selection is enabled. */
|
|
452
|
+
autoLevelEnabled: boolean;
|
|
453
|
+
/** {zh} @brief hls.js 自动选档的 Level 上限;未设置时为 `-1`。 */
|
|
454
|
+
/** {en} @brief hls.js automatic Level cap; `-1` when unset. */
|
|
455
|
+
autoLevelCapping: number;
|
|
456
|
+
}
|
|
457
|
+
/** {zh}
|
|
458
|
+
* @brief HLS Level 手动切换模式。
|
|
459
|
+
* @detail ref
|
|
460
|
+
*/
|
|
461
|
+
/** {en}
|
|
462
|
+
* @brief Manual HLS Level switching mode.
|
|
463
|
+
* @detail ref
|
|
464
|
+
*/
|
|
465
|
+
export type HlsLevelSwitchMode = "immediate" | "next-fragment" | "smooth";
|
|
466
|
+
/** {zh}
|
|
467
|
+
* @brief 手动切换 HLS Level 的选项。
|
|
468
|
+
* @detail ref
|
|
469
|
+
*/
|
|
470
|
+
/** {en}
|
|
471
|
+
* @brief Options for manually switching an HLS Level.
|
|
472
|
+
* @detail ref
|
|
473
|
+
*/
|
|
474
|
+
export interface IHlsLevelSwitchOptions {
|
|
475
|
+
/** {zh} @brief 切换模式,默认为 `next-fragment`。 */
|
|
476
|
+
/** {en} @brief Switching mode. Defaults to `next-fragment`. */
|
|
477
|
+
mode?: HlsLevelSwitchMode;
|
|
478
|
+
/** {zh} @brief 可选的播放会话 ID;不匹配时拒绝本次切换。 */
|
|
479
|
+
/** {en} @brief Optional playback session ID; a mismatch rejects the switch. */
|
|
480
|
+
playbackSessionId?: string;
|
|
481
|
+
}
|
|
482
|
+
/** {zh}
|
|
483
|
+
* @brief HLS Level 切换事件数据。
|
|
484
|
+
* @detail ref
|
|
485
|
+
*/
|
|
486
|
+
/** {en}
|
|
487
|
+
* @brief HLS Level switching event payload.
|
|
488
|
+
* @detail ref
|
|
489
|
+
*/
|
|
490
|
+
export interface IHlsLevelSwitchEvent {
|
|
491
|
+
/** {zh} @brief 事件所属的播放会话 ID。 */
|
|
492
|
+
/** {en} @brief Playback session ID that owns the event. */
|
|
493
|
+
playbackSessionId: string;
|
|
494
|
+
/** {zh} @brief 切换前的 Level 索引。 */
|
|
495
|
+
/** {en} @brief Level index before switching. */
|
|
496
|
+
from: number;
|
|
497
|
+
/** {zh} @brief 目标或已切换到的 Level 索引。 */
|
|
498
|
+
/** {en} @brief Target or switched-to Level index. */
|
|
499
|
+
to: number;
|
|
500
|
+
/** {zh} @brief 本次切换由手动操作还是 ABR 触发。 */
|
|
501
|
+
/** {en} @brief Whether the switch was triggered manually or by ABR. */
|
|
502
|
+
reason: "manual" | "abr";
|
|
503
|
+
/** {zh} @brief 当前播放会话的 ABR 决策引擎。 */
|
|
504
|
+
/** {en} @brief ABR decision engine for the current playback session. */
|
|
505
|
+
abrEngine: ResolvedAbrEngine;
|
|
506
|
+
/** {zh} @brief 目标或已生效的安全 Level 快照。 */
|
|
507
|
+
/** {en} @brief Safe snapshot of the target or active Level. */
|
|
508
|
+
level?: IHlsLevel;
|
|
509
|
+
}
|
|
510
|
+
/** {zh}
|
|
511
|
+
* @brief `HLS_SUBTITLE_TRACKS_UPDATED` 事件数据。
|
|
512
|
+
* @detail ref
|
|
513
|
+
*/
|
|
514
|
+
/** {en}
|
|
515
|
+
* @brief Payload of the `HLS_SUBTITLE_TRACKS_UPDATED` event.
|
|
516
|
+
* @detail ref
|
|
517
|
+
*/
|
|
518
|
+
export interface IHlsSubtitleTracksUpdatedEvent {
|
|
519
|
+
/** {zh} @brief 事件所属的播放会话 ID。 */
|
|
520
|
+
/** {en} @brief Playback session ID that owns the event. */
|
|
521
|
+
playbackSessionId: string;
|
|
522
|
+
/** {zh} @brief 当前实际使用的 HLS 播放内核。 */
|
|
523
|
+
/** {en} @brief HLS playback engine actually used by the session. */
|
|
524
|
+
playbackEngine: HlsPlaybackEngine;
|
|
525
|
+
/** {zh} @brief 不含播放地址和底层轨道索引的安全字幕列表。 */
|
|
526
|
+
/** {en} @brief Safe subtitle list without media URLs or internal track indexes. */
|
|
527
|
+
tracks: ReadonlyArray<ISubTitleItem>;
|
|
528
|
+
}
|
|
529
|
+
/** {zh}
|
|
530
|
+
* @brief HLS 字幕轨切换事件数据。
|
|
531
|
+
* @detail ref
|
|
532
|
+
*/
|
|
533
|
+
/** {en}
|
|
534
|
+
* @brief HLS subtitle-track switching event payload.
|
|
535
|
+
* @detail ref
|
|
536
|
+
*/
|
|
537
|
+
export interface IHlsSubtitleTrackSwitchEvent {
|
|
538
|
+
/** {zh} @brief 事件所属的播放会话 ID。 */
|
|
539
|
+
/** {en} @brief Playback session ID that owns the event. */
|
|
540
|
+
playbackSessionId: string;
|
|
541
|
+
/** {zh} @brief 当前实际使用的 HLS 播放内核。 */
|
|
542
|
+
/** {en} @brief HLS playback engine actually used by the session. */
|
|
543
|
+
playbackEngine: HlsPlaybackEngine;
|
|
544
|
+
/** {zh} @brief 切换前的安全字幕 ID;关闭状态为 `null`。 */
|
|
545
|
+
/** {en} @brief Safe subtitle ID before switching, or `null` when disabled. */
|
|
546
|
+
from: string | number | null;
|
|
547
|
+
/** {zh} @brief 目标或已生效的安全字幕 ID;关闭状态为 `null`。 */
|
|
548
|
+
/** {en} @brief Target or active safe subtitle ID, or `null` when disabled. */
|
|
549
|
+
to: string | number | null;
|
|
550
|
+
/** {zh} @brief 目标或已生效的安全字幕快照。 */
|
|
551
|
+
/** {en} @brief Safe snapshot of the target or active subtitle track. */
|
|
552
|
+
track?: ISubTitleItem;
|
|
553
|
+
}
|
|
554
|
+
/** {zh}
|
|
555
|
+
* @brief HLS 控制 API 的标准错误码。
|
|
556
|
+
* @detail ref
|
|
557
|
+
*/
|
|
558
|
+
/** {en}
|
|
559
|
+
* @brief Standard error codes for HLS control APIs.
|
|
560
|
+
* @detail ref
|
|
561
|
+
*/
|
|
562
|
+
export type HlsControlErrorCode = "HLS_MANIFEST_NOT_READY" | "HLS_ENGINE_UNSUPPORTED" | "HLS_LEVEL_OUT_OF_RANGE" | "HLS_PLAYBACK_SESSION_EXPIRED" | "HLS_ABR_UNAVAILABLE" | "HLS_ABR_LIMIT_UNSUPPORTED" | "HLS_SUBTITLE_TRACK_NOT_FOUND" | "HLS_SUBTITLE_TRACK_AMBIGUOUS" | "HLS_SUBTITLE_SWITCH_FAILED" | "HLS_SUBTITLE_SWITCH_TIMEOUT";
|
|
563
|
+
/** {zh}
|
|
564
|
+
* @brief HLS Level、ABR 或字幕控制失败时抛出的标准错误。
|
|
565
|
+
* @detail Api
|
|
566
|
+
*/
|
|
567
|
+
/** {en}
|
|
568
|
+
* @brief Standard error thrown when HLS Level, ABR, or subtitle control fails.
|
|
569
|
+
* @detail Api
|
|
570
|
+
*/
|
|
571
|
+
export declare class HlsControlError extends Error {
|
|
572
|
+
/** {zh} @brief 稳定的 HLS 控制错误码。 */
|
|
573
|
+
/** {en} @brief Stable HLS control error code. */
|
|
574
|
+
readonly code: HlsControlErrorCode;
|
|
575
|
+
constructor(code: HlsControlErrorCode, message: string);
|
|
576
|
+
}
|
|
577
|
+
/** {zh}
|
|
578
|
+
* @list Options
|
|
579
|
+
* @brief 自适应码率配置。
|
|
580
|
+
* @kind property
|
|
581
|
+
*/
|
|
582
|
+
/** {en}
|
|
583
|
+
* @list Options
|
|
584
|
+
* @brief Adaptive bitrate (ABR) playback configuration.
|
|
585
|
+
* @kind property
|
|
586
|
+
*/
|
|
587
|
+
export interface IAutoBitrateOpts {
|
|
588
|
+
/** {zh}
|
|
589
|
+
* @brief 是否开启自适应码率功能。
|
|
590
|
+
* @default false
|
|
591
|
+
*/
|
|
592
|
+
/** {en}
|
|
593
|
+
* @brief Whether to enable adaptive bitrate (ABR).
|
|
594
|
+
* @default false
|
|
595
|
+
*/
|
|
596
|
+
enable: boolean;
|
|
597
|
+
/** {zh}
|
|
598
|
+
* @brief HLS 自动码率决策引擎。仅对 HLS 生效;开启 ABR 但不设置时,为兼容旧版本使用 VePlayer ABR。
|
|
599
|
+
* @default veplayer
|
|
600
|
+
*/
|
|
601
|
+
/** {en}
|
|
602
|
+
* @brief HLS adaptive-bitrate decision engine. Applies only to HLS; when ABR is enabled and this field is omitted, VePlayer ABR is used for backward compatibility.
|
|
603
|
+
* @default veplayer
|
|
604
|
+
*/
|
|
605
|
+
engine?: HlsAbrEngine;
|
|
606
|
+
/** {zh}
|
|
607
|
+
* @brief 是否以自动清晰度档位起播。开启自适应码率功能且 `defaultDefinition` 为 `auto` 时,才会以自动清晰度档位起播。
|
|
608
|
+
* @default false
|
|
609
|
+
*/
|
|
610
|
+
/** {en}
|
|
611
|
+
* @brief Whether to start playback with the auto definition level. Takes effect only when ABR is enabled and `defaultDefinition` is `auto`.
|
|
612
|
+
* @default false
|
|
613
|
+
*/
|
|
614
|
+
startWithAuto?: boolean;
|
|
615
|
+
/** {zh}
|
|
616
|
+
* @brief 自动清晰度档位是否展示当前实际清晰度,如自动(720p)。
|
|
617
|
+
* @default false
|
|
618
|
+
*/
|
|
619
|
+
/** {en}
|
|
620
|
+
* @brief Whether the auto definition label shows the actual resolution, e.g. Auto (720p).
|
|
621
|
+
* @default false
|
|
622
|
+
*/
|
|
623
|
+
showRealDefinition?: boolean;
|
|
624
|
+
/** {zh}
|
|
625
|
+
* @brief 自动清晰度档位的显示文案。
|
|
626
|
+
* @default 自动
|
|
627
|
+
*/
|
|
628
|
+
/** {en}
|
|
629
|
+
* @brief Display text for the auto definition level.
|
|
630
|
+
* @default auto
|
|
631
|
+
*/
|
|
632
|
+
autoDefinitionText?: string;
|
|
633
|
+
/** {zh}
|
|
634
|
+
* @brief 自动清晰度档位的多语言 key。
|
|
635
|
+
* @default DEFINITION_AUTO
|
|
636
|
+
*/
|
|
637
|
+
/** {en}
|
|
638
|
+
* @brief i18n key for the auto definition level label.
|
|
639
|
+
* @default DEFINITION_AUTO
|
|
640
|
+
*/
|
|
641
|
+
definitionTextKey?: string;
|
|
642
|
+
/**
|
|
643
|
+
* @hidden
|
|
644
|
+
* @brief 软解module
|
|
645
|
+
*/
|
|
646
|
+
module?: unknown;
|
|
647
|
+
}
|
|
25
648
|
/** Video and audio codec names supported by the player. */
|
|
26
649
|
export declare const CodecType: {
|
|
27
650
|
readonly H264: "h264";
|
|
@@ -373,6 +996,8 @@ export interface LiteSubtitleConfig {
|
|
|
373
996
|
list?: LiteSubtitleItem[];
|
|
374
997
|
defaultSubtitleId?: string | number;
|
|
375
998
|
defaultSubtitleLanguage?: string | number;
|
|
999
|
+
mode?: "external" | "native";
|
|
1000
|
+
nativeRenderMode?: "system" | "dom";
|
|
376
1001
|
updateMode?: "vod";
|
|
377
1002
|
[key: string]: unknown;
|
|
378
1003
|
}
|
|
@@ -533,6 +1158,7 @@ export interface LitePlayerConfig<MediaUrl extends LiteMediaUrl = LiteMediaUrl,
|
|
|
533
1158
|
mobile?: LiteMobileConfig;
|
|
534
1159
|
start?: LiteStartConfig;
|
|
535
1160
|
enableHlsMSE?: boolean;
|
|
1161
|
+
hlsLevelSwitchMode?: HlsLevelSwitchMode;
|
|
536
1162
|
useHlsPluginForSafari?: boolean;
|
|
537
1163
|
enableMp4MSE?: boolean;
|
|
538
1164
|
defaultDefinition?: string;
|
|
@@ -593,6 +1219,10 @@ export interface LiteSubtitleItem {
|
|
|
593
1219
|
label?: string | number;
|
|
594
1220
|
text?: string;
|
|
595
1221
|
url?: string;
|
|
1222
|
+
isDefault?: boolean;
|
|
1223
|
+
source?: "config" | "hls";
|
|
1224
|
+
forced?: boolean;
|
|
1225
|
+
characteristics?: string;
|
|
596
1226
|
}
|
|
597
1227
|
export interface LitePluginInstance {
|
|
598
1228
|
readonly pluginName?: string;
|
|
@@ -615,6 +1245,10 @@ export interface LiteVePlayer {
|
|
|
615
1245
|
emit(action: string, payload?: unknown): void;
|
|
616
1246
|
getCurrentPlayerConfig(): LiteDefaultConfig;
|
|
617
1247
|
getDefinitionList(): LiteDefinition[];
|
|
1248
|
+
getHlsAbrLimit(): IHlsAbrLimit;
|
|
1249
|
+
getHlsAbrState(): IHlsAbrState;
|
|
1250
|
+
getHlsLevels(): IHlsLevel[];
|
|
1251
|
+
getHlsLevelState(): IHlsLevelState;
|
|
618
1252
|
getLogUserId(): string | undefined;
|
|
619
1253
|
getPlayerInstance(): unknown;
|
|
620
1254
|
getPlugin(pluginName: string): LitePluginInstance | null;
|
|
@@ -627,6 +1261,9 @@ export interface LiteVePlayer {
|
|
|
627
1261
|
once(action: string, func: (...args: unknown[]) => void): void;
|
|
628
1262
|
playNext<MediaUrl extends LiteMediaUrl, StreamUrl extends LiteMediaUrl>(config: LitePlayerConfig<MediaUrl, StreamUrl>, isNewVideo?: boolean): Promise<unknown>;
|
|
629
1263
|
showSubtitle(): void;
|
|
1264
|
+
setHlsAbrLimit(limit: IHlsAbrLimit): void;
|
|
1265
|
+
setHlsAbrMode(mode: HlsAbrMode): void;
|
|
1266
|
+
setHlsLevel(levelIndex: number, options?: IHlsLevelSwitchOptions): void;
|
|
630
1267
|
switchAuthToken(config: LitePlayAuthTokenConfig, isNewVideo?: boolean): Promise<void>;
|
|
631
1268
|
switchSubtitle(subtitle: {
|
|
632
1269
|
id?: string | number;
|