@volcengine/veplayer 2.6.1 → 2.7.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.
package/veplayer.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import Player from "xgplayer";
2
2
  import { IXGI18nText, Plugin, IPluginOptions, Sniffer } from "xgplayer";
3
3
  import { IPlayerOptions as PlayerOptions } from "xgplayer";
4
- import { IDefinition as XGDefinition } from "xgplayer";
5
4
  import { default as Player$0 } from "xgplayer";
6
5
  import { IError as XGError } from "xgplayer";
7
6
  import { IBasePluginOptions as XGPluginOptions } from "xgplayer";
@@ -164,8 +163,8 @@ interface DefinitionUrl {
164
163
  url: string;
165
164
  next: DefinitionUrl | null;
166
165
  }
167
- declare class Definition implements XGDefinition {
168
- readonly definition: string;
166
+ declare class Definition {
167
+ readonly definition?: string;
169
168
  readonly source: Source;
170
169
  readonly text?: Record<Lang, string> | string;
171
170
  readonly fallbackUrl: DefinitionUrl;
@@ -173,7 +172,7 @@ declare class Definition implements XGDefinition {
173
172
  private _currentUrlRef;
174
173
  constructor(definitionSetting: {
175
174
  url: string;
176
- definition: string;
175
+ definition?: string;
177
176
  source: Source;
178
177
  text?: Record<Lang, string> | string;
179
178
  fallbackUrls?: string[];
@@ -199,7 +198,6 @@ declare class Definition implements XGDefinition {
199
198
  interface ExposedDefinition {
200
199
  /** {zh}
201
200
  * @brief 播放地址。
202
- * @default 无
203
201
  */
204
202
  /** {en}
205
203
  * @brief The playback address.
@@ -207,17 +205,14 @@ interface ExposedDefinition {
207
205
  url: string;
208
206
  /** {zh}
209
207
  * @brief 清晰度标识(唯一值)。
210
- * @default 无
211
- *
212
208
  */
213
209
  /** {en}
214
210
  * @brief The resolution ID. This value must be unique.
215
211
  *
216
212
  */
217
- definition: string;
213
+ definition?: string;
218
214
  /** {zh}
219
215
  * @brief 清晰度展示名称。可设置多语言 `{text: {'zh-cn': '高清', 'en': 'HD'}}`。
220
- * @default 无
221
216
  */
222
217
  /** {en}
223
218
  * @brief The display name of the resolution. Multiple languages are supported, such as `{text: {'zh-cn': '高清', 'en': 'HD'}}`.
@@ -225,14 +220,13 @@ interface ExposedDefinition {
225
220
  text?: Record<Lang, string> | string;
226
221
  /** {zh}
227
222
  * @brief 为当前清晰度地址设置备路拉流地址,支持设置多个备路拉流地址。当前清晰度地址拉流失败时,会在当前清晰度地址和备路直播地址之间循环拉流,直到拉流成功。
228
- * @default 无
229
- *
230
223
  */
231
224
  /** {en}
232
225
  * @brief The backup pull stream address for the current resolution. You can set multiple backup addresses. When the player fails to pull a stream from the current address, it will loop between the current and the backup addresses until it successfully pulls a stream.
233
226
  *
234
227
  */
235
228
  fallbackUrls?: string[];
229
+ type?: string;
236
230
  }
237
231
  /** {zh}
238
232
  * @list option
@@ -249,7 +243,6 @@ interface ExposedDefinition {
249
243
  interface ExposedSource {
250
244
  /** {zh}
251
245
  * @brief 线路标识(唯一值)。
252
- * @default 无
253
246
  */
254
247
  /** {en}
255
248
  * @brief The playback source ID. This value must be unique.
@@ -257,8 +250,6 @@ interface ExposedSource {
257
250
  name?: string;
258
251
  /** {zh}
259
252
  * @brief 线路展示名称。可设置多语言 `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`。
260
- * @default 无
261
- *
262
253
  */
263
254
  /** {en}
264
255
  * @brief The display name of the live stream source. Multiple languages are supported. For example, you set it to `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`.
@@ -267,8 +258,6 @@ interface ExposedSource {
267
258
  text?: Record<Lang, string> | string;
268
259
  /** {zh}
269
260
  * @brief 该线路下清晰度列表。
270
- * @default 无
271
- *
272
261
  */
273
262
  /** {en}
274
263
  * @brief A list of resolutions of the current source.
@@ -478,25 +467,24 @@ declare class OptionsIcon extends Plugin {
478
467
  */
479
468
  declare enum Level {
480
469
  /** {zh}
481
- * @brief 严重。
470
+ * @brief 发生严重错误,可能由于 CDN 拉取失败或 DRM 权限验证未通过,导致无法播放。
482
471
  */
483
472
  /** {en}
484
- * @brief Fatal.
485
- *
473
+ * @brief A critical error occurs, typically due to CDN fetching failure or DRM permission verification failure, resulting in playback inability.
486
474
  */
487
475
  Fatal = "Fatal",
488
476
  /** {zh}
489
- * @brief 报错。
477
+ * @brief 流异常或处于离线状态,致使播放失败。
490
478
  */
491
479
  /** {en}
492
- * @brief Error.
480
+ * @brief A stream anomaly or offline state causes playback to fail.
493
481
  */
494
482
  Error = "Error",
495
483
  /** {zh}
496
- * @brief 提示。
484
+ * @brief 出现警告信息,通常由日志配置错误或缺少 RTM 降级地址引起。
497
485
  */
498
486
  /** {en}
499
- * @brief Warn.
487
+ * @brief A warning is issued, usually due to incorrect log configuration or a missing RTM fallback address.
500
488
  */
501
489
  Warn = "Warn"
502
490
  }
@@ -949,7 +937,6 @@ type ErrorConfig = {
949
937
  showRefresh?: boolean;
950
938
  /** {zh}
951
939
  * @brief 自定义报错显示。
952
- * @default 无
953
940
  */
954
941
  /** {en}
955
942
  * @brief Custom error message.
@@ -958,7 +945,6 @@ type ErrorConfig = {
958
945
  errorTipsText?: string | Record<Lang, string>;
959
946
  /** {zh}
960
947
  * @brief 更多提示信息。
961
- * @default 无
962
948
  */
963
949
  /** {en}
964
950
  * @brief More tips.
@@ -1118,7 +1104,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1118
1104
  id?: string;
1119
1105
  /** {zh}
1120
1106
  * @brief 指定播放器容器元素,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
1121
- * @default 无
1122
1107
  */
1123
1108
  /** {en}
1124
1109
  * @brief The container element of the player. You should specify either `id` or `el`, or both. If both are specified, the `VePlayer` object will be inserted in the container specified by `id`.
@@ -1144,7 +1129,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1144
1129
  height?: number | string;
1145
1130
  /** {zh}
1146
1131
  * @brief 为播放器配置直播拉流地址。您可手动拼接或使用地址生成器生成拉流地址,生成方法请参见[生成直播地址](https://www.volcengine.com/docs/6469/107759)。url 和 playList 需至少传入 1 个。
1147
- * @default 无
1148
1132
  */
1149
1133
  /** {en}
1150
1134
  * @brief The pull stream address. You can manually construct the address or use the address generator to generate one. To see how to generate an address, refer to [Generate live-stream addresses](https://docs.byteplus.com/en/byteplus-media-live/docs/generating-live-stream-addresses). You should specify either `url` or `playList`, or both.
@@ -1152,7 +1136,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1152
1136
  url?: string;
1153
1137
  /** {zh}
1154
1138
  * @brief 为播放器配置直播拉流地址列表。url 和 playlist 需至少传入 1 个。
1155
- * @default 无
1156
1139
  */
1157
1140
  /** {en}
1158
1141
  * @brief A list of live stream sources for the player. You should specify either `url` or `playList`, or both.
@@ -1160,7 +1143,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1160
1143
  playlist?: ExposedSource[];
1161
1144
  /** {zh}
1162
1145
  * @brief 当存在多个直播线路时,为播放器设置默认直播线路,不传则默认列表第一个。
1163
- * @default 无
1164
1146
  */
1165
1147
  /** {en}
1166
1148
  * @brief The default pull stream address for the player when there are multiple addresses available. If this parameter is not specified, the first address in the playlist will become the default address.
@@ -1168,7 +1150,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1168
1150
  defaultSource?: string;
1169
1151
  /** {zh}
1170
1152
  * @brief 为播放器设置默认直播清晰度,不传则默认列表第一个。
1171
- * @default 无
1172
1153
  */
1173
1154
  /** {en}
1174
1155
  * @brief The default resolution for the player when there are multiple resolutions available. If this parameter is not specified, the first resolution in the list will become the default resolution.
@@ -1176,7 +1157,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1176
1157
  defaultDefinition?: string;
1177
1158
  /** {zh}
1178
1159
  * @brief 为播放器设置备路拉流地址,支持设置多个备路拉流地址,在 `maxFallbackRound` 大于 `0` 时有效。当您使用配置的直播拉流地址拉流失败时,会在直播地址和备路直播地址之间循环拉流,直到拉流成功。
1179
- * @default 无
1180
1160
  */
1181
1161
  /** {en}
1182
1162
  * @brief The backup pull stream address(es) for the player. You can enter multiple backup addresses. If `maxFallbackRound` is greater than `0`, when an error occurs in the main address, the player automatically switches to the backup address.
@@ -1230,7 +1210,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1230
1210
  degradation?: Degradation | boolean;
1231
1211
  /** {zh}
1232
1212
  * @brief 为播放器设置封面图 URL。
1233
- * @default 无
1234
1213
  */
1235
1214
  /** {en}
1236
1215
  * @brief The URL of the player's cover image.
@@ -1246,7 +1225,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1246
1225
  /** {zh}
1247
1226
  * @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }。
1248
1227
  * 例如,{ texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }} ,格式请参考[默认词典](https://www.volcengine.com/docs/6469/127529)。
1249
- * @default 无
1250
1228
  */
1251
1229
  /** {en}
1252
1230
  * @brief Configures a custom multilingual dictionary for the player. You can set the dictionary for each language in the format { texts: { [key: string]: Object; } }. For example, { texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }}.
@@ -1256,7 +1234,7 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1256
1234
  texts: Record<Lang, Record<string, string>>;
1257
1235
  };
1258
1236
  /** {zh}
1259
- * @brief 为播放器设置是否自动播放, `muted` 设置为 `true` 为静音自动播放。
1237
+ * @brief 为播放器设置是否自动播放,`muted` 设置为 `true` 为静音自动播放。
1260
1238
  * @default { muted: true }
1261
1239
  * @type {{ muted: boolean } | boolean}
1262
1240
  */
@@ -1362,7 +1340,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1362
1340
  playsinline?: boolean;
1363
1341
  /** {zh}
1364
1342
  * @brief 为播放器设置 video 标签扩展属性,初始化时会设置在 videoElement 或 audioElement 对象上,请参考 [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) 查看其支持的属性配置。
1365
- * @default 无
1366
1343
  */
1367
1344
  /** {en}
1368
1345
  * @brief Additional properties for the `video` element that will be applied when the `videoElement` or `audioElement` objects are initialized. Refer to [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) for supported properties.
@@ -1440,7 +1417,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1440
1417
  marginControls?: boolean;
1441
1418
  /** {zh}
1442
1419
  * @brief 启用微信同层播放。
1443
- * @default 无
1444
1420
  */
1445
1421
  /** {en}
1446
1422
  * @brief Enable playing the video on the same player as WeChat.
@@ -1450,7 +1426,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1450
1426
  * @brief 是否启用微信全屏播放模式。
1451
1427
  * - `true`:启用
1452
1428
  * - `false`:停用
1453
- * @default 无
1454
1429
  */
1455
1430
  /** {en}
1456
1431
  * @brief Whether to enable full-screen playback in WeChat.
@@ -1463,7 +1438,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1463
1438
  * - `landscape`:横屏
1464
1439
  * - `portrait`:竖屏
1465
1440
  * - `landscape|portrait`:跟随手机自动旋转
1466
- * @default 无
1467
1441
  */
1468
1442
  /** {en}
1469
1443
  * @brief The orientation of the video when played on WeChat. The following values are supported:
@@ -1474,7 +1448,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1474
1448
  "x5-video-orientation"?: "landscape" | "portrait" | "landscape|portrait";
1475
1449
  /** {zh}
1476
1450
  * @brief 为播放器配置关键点样式。
1477
- * @default 无
1478
1451
  * @hidden 直播目前没用到
1479
1452
  */
1480
1453
  /** {en}
@@ -1484,7 +1457,6 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1484
1457
  commonStyle?: CommonStyle;
1485
1458
  /** {zh}
1486
1459
  * @brief 自定义插件列表。
1487
- * @default 无
1488
1460
  */
1489
1461
  /** {en}
1490
1462
  * @brief A list of custom plugins.
@@ -1527,10 +1499,10 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
1527
1499
  */
1528
1500
  closeVideoDblclick?: boolean;
1529
1501
  /** {zh}
1530
- * @brief 支持传入 video dom,常应用于多播放器复用同一 video 场景。
1502
+ * @brief 支持传入 `video` DOM 元素,适用于多个播放器共享同一视频场景。
1531
1503
  */
1532
1504
  /** {en}
1533
- * @brief Supports passing in video DOM, commonly used for reusing the same video scene across multiple players.
1505
+ * @brief Supports passing in a `video` DOM element, suitable for scenarios where multiple players share the same video.
1534
1506
  */
1535
1507
  mediaElement?: HTMLVideoElement | null;
1536
1508
  }
@@ -1599,7 +1571,6 @@ interface Fullscreen {
1599
1571
  interface CommonStyle {
1600
1572
  /** {zh}
1601
1573
  * @brief 进度条底色。
1602
- * @default 无
1603
1574
  */
1604
1575
  /** {en}
1605
1576
  * @brief The background color of the progress bar.
@@ -1607,7 +1578,6 @@ interface CommonStyle {
1607
1578
  progressColor?: string;
1608
1579
  /** {zh}
1609
1580
  * @brief 播放完成部分进度条底色。
1610
- * @default 无
1611
1581
  */
1612
1582
  /** {en}
1613
1583
  * @brief The background color of the progress bar for the completed portion of video playback.
@@ -1615,7 +1585,6 @@ interface CommonStyle {
1615
1585
  playedColor?: string;
1616
1586
  /** {zh}
1617
1587
  * @brief 缓存部分进度条底色。
1618
- * @default 无
1619
1588
  */
1620
1589
  /** {en}
1621
1590
  * @brief
@@ -1624,7 +1593,6 @@ interface CommonStyle {
1624
1593
  cachedColor?: string;
1625
1594
  /** {zh}
1626
1595
  * @brief 进度条滑块样式。
1627
- * @default 无
1628
1596
  */
1629
1597
  /** {en}
1630
1598
  * @brief The style of the progress bar slider.
@@ -1635,7 +1603,6 @@ interface CommonStyle {
1635
1603
  };
1636
1604
  /** {zh}
1637
1605
  * @brief 音量颜色。
1638
- * @default 无
1639
1606
  */
1640
1607
  /** {en}
1641
1608
  * @brief The color of the volume slider.
@@ -1646,9 +1613,10 @@ type PrepareResult = {
1646
1613
  options?: Partial<VePlayerBaseOptions>;
1647
1614
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1648
1615
  plugins?: any[];
1616
+ protocol?: string;
1649
1617
  useSrc?: boolean;
1650
1618
  };
1651
- type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
1619
+ type PreparePlugins = (url?: string) => Promise<PrepareResult | undefined> | undefined;
1652
1620
  /** {zh}
1653
1621
  * @detail option
1654
1622
  * @brief 视频的实际编码格式。如果您在 degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
@@ -1772,6 +1740,7 @@ declare class VePlayerBase {
1772
1740
  private _events;
1773
1741
  private _customMedia?;
1774
1742
  private _errorCallback;
1743
+ private _beforeFallbackError;
1775
1744
  /** {zh}
1776
1745
  * @hidden
1777
1746
  */
@@ -1811,7 +1780,7 @@ declare class VePlayerBase {
1811
1780
  */
1812
1781
  get played(): TimeRanges;
1813
1782
  /** {zh}
1814
- * @brief 设置/获取视频当前的播放时间, 单位为 s。
1783
+ * @brief 设置/获取视频当前的播放时间,单位为 s。
1815
1784
  */
1816
1785
  /** {en}
1817
1786
  * @brief Sets or gets the current playback position of the video, in seconds.
@@ -1922,7 +1891,7 @@ declare class VePlayerBase {
1922
1891
  /** {en}
1923
1892
  * @brief Gets the current resolution ID.
1924
1893
  */
1925
- get definition(): string;
1894
+ get definition(): string | undefined;
1926
1895
  /** {zh}
1927
1896
  * @brief 获取和设置播放器的跨域配置信息,更多信息参考 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性介绍。
1928
1897
  */
@@ -2012,7 +1981,6 @@ declare class VePlayerBase {
2012
1981
  switch(target: string | {
2013
1982
  /** {zh}
2014
1983
  * @brief 清晰度的唯一标识。
2015
- * @default 无
2016
1984
  */
2017
1985
  /** {en}
2018
1986
  * @brief The resolution ID.
@@ -2020,7 +1988,6 @@ declare class VePlayerBase {
2020
1988
  definition?: string;
2021
1989
  /** {zh}
2022
1990
  * @brief 线路的唯一标识。
2023
- * @default 无
2024
1991
  */
2025
1992
  /** {en}
2026
1993
  * @brief The playback source ID.
@@ -2060,8 +2027,6 @@ declare class VePlayerBase {
2060
2027
  updatePlaylist(playlist: ExposedSource[] | string, target?: string | {
2061
2028
  /** {zh}
2062
2029
  * @brief 清晰度唯一标识。
2063
- * @default 无
2064
- *
2065
2030
  */
2066
2031
  /** {en}
2067
2032
  * @brief The resolution ID.
@@ -2070,8 +2035,6 @@ declare class VePlayerBase {
2070
2035
  definition?: string;
2071
2036
  /** {zh}
2072
2037
  * @brief 线路的唯一标识。
2073
- * @default 无
2074
- *
2075
2038
  */
2076
2039
  /** {en}
2077
2040
  * @brief The playback resource ID.
@@ -2272,7 +2235,6 @@ declare class VePlayerBase {
2272
2235
  Function | {
2273
2236
  /** {zh}
2274
2237
  * @brief 插件构造函数。
2275
- * @default 无
2276
2238
  */
2277
2239
  /** {en}
2278
2240
  * @brief The plugin constructor.
@@ -2281,7 +2243,6 @@ declare class VePlayerBase {
2281
2243
  plugin: Function;
2282
2244
  /** {zh}
2283
2245
  * @brief 插件配置参数。
2284
- * @default 无
2285
2246
  */
2286
2247
  /** {en}
2287
2248
  * @brief The plugin configurations.
@@ -2547,8 +2508,8 @@ declare namespace strategy {
2547
2508
  next: DefinitionUrl | null;
2548
2509
  }
2549
2510
  function arrayToList(urls?: string[]): DefinitionUrl;
2550
- class Definition implements XGDefinition {
2551
- readonly definition: string;
2511
+ class Definition {
2512
+ readonly definition?: string;
2552
2513
  readonly source: Source;
2553
2514
  readonly text?: Record<Lang, string> | string;
2554
2515
  readonly fallbackUrl: DefinitionUrl;
@@ -2556,7 +2517,7 @@ declare namespace strategy {
2556
2517
  private _currentUrlRef;
2557
2518
  constructor(definitionSetting: {
2558
2519
  url: string;
2559
- definition: string;
2520
+ definition?: string;
2560
2521
  source: Source;
2561
2522
  text?: Record<Lang, string> | string;
2562
2523
  fallbackUrls?: string[];
@@ -2582,7 +2543,6 @@ declare namespace strategy {
2582
2543
  interface ExposedDefinition {
2583
2544
  /** {zh}
2584
2545
  * @brief 播放地址。
2585
- * @default 无
2586
2546
  */
2587
2547
  /** {en}
2588
2548
  * @brief The playback address.
@@ -2590,17 +2550,14 @@ declare namespace strategy {
2590
2550
  url: string;
2591
2551
  /** {zh}
2592
2552
  * @brief 清晰度标识(唯一值)。
2593
- * @default 无
2594
- *
2595
2553
  */
2596
2554
  /** {en}
2597
2555
  * @brief The resolution ID. This value must be unique.
2598
2556
  *
2599
2557
  */
2600
- definition: string;
2558
+ definition?: string;
2601
2559
  /** {zh}
2602
2560
  * @brief 清晰度展示名称。可设置多语言 `{text: {'zh-cn': '高清', 'en': 'HD'}}`。
2603
- * @default 无
2604
2561
  */
2605
2562
  /** {en}
2606
2563
  * @brief The display name of the resolution. Multiple languages are supported, such as `{text: {'zh-cn': '高清', 'en': 'HD'}}`.
@@ -2608,14 +2565,13 @@ declare namespace strategy {
2608
2565
  text?: Record<Lang, string> | string;
2609
2566
  /** {zh}
2610
2567
  * @brief 为当前清晰度地址设置备路拉流地址,支持设置多个备路拉流地址。当前清晰度地址拉流失败时,会在当前清晰度地址和备路直播地址之间循环拉流,直到拉流成功。
2611
- * @default 无
2612
- *
2613
2568
  */
2614
2569
  /** {en}
2615
2570
  * @brief The backup pull stream address for the current resolution. You can set multiple backup addresses. When the player fails to pull a stream from the current address, it will loop between the current and the backup addresses until it successfully pulls a stream.
2616
2571
  *
2617
2572
  */
2618
2573
  fallbackUrls?: string[];
2574
+ type?: string;
2619
2575
  }
2620
2576
  /** {zh}
2621
2577
  * @list option
@@ -2632,7 +2588,6 @@ declare namespace strategy {
2632
2588
  interface ExposedSource {
2633
2589
  /** {zh}
2634
2590
  * @brief 线路标识(唯一值)。
2635
- * @default 无
2636
2591
  */
2637
2592
  /** {en}
2638
2593
  * @brief The playback source ID. This value must be unique.
@@ -2640,8 +2595,6 @@ declare namespace strategy {
2640
2595
  name?: string;
2641
2596
  /** {zh}
2642
2597
  * @brief 线路展示名称。可设置多语言 `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`。
2643
- * @default 无
2644
- *
2645
2598
  */
2646
2599
  /** {en}
2647
2600
  * @brief The display name of the live stream source. Multiple languages are supported. For example, you set it to `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`.
@@ -2650,8 +2603,6 @@ declare namespace strategy {
2650
2603
  text?: Record<Lang, string> | string;
2651
2604
  /** {zh}
2652
2605
  * @brief 该线路下清晰度列表。
2653
- * @default 无
2654
- *
2655
2606
  */
2656
2607
  /** {en}
2657
2608
  * @brief A list of resolutions of the current source.
@@ -2858,25 +2809,24 @@ declare namespace strategy {
2858
2809
  */
2859
2810
  enum Level {
2860
2811
  /** {zh}
2861
- * @brief 严重。
2812
+ * @brief 发生严重错误,可能由于 CDN 拉取失败或 DRM 权限验证未通过,导致无法播放。
2862
2813
  */
2863
2814
  /** {en}
2864
- * @brief Fatal.
2865
- *
2815
+ * @brief A critical error occurs, typically due to CDN fetching failure or DRM permission verification failure, resulting in playback inability.
2866
2816
  */
2867
2817
  Fatal = "Fatal",
2868
2818
  /** {zh}
2869
- * @brief 报错。
2819
+ * @brief 流异常或处于离线状态,致使播放失败。
2870
2820
  */
2871
2821
  /** {en}
2872
- * @brief Error.
2822
+ * @brief A stream anomaly or offline state causes playback to fail.
2873
2823
  */
2874
2824
  Error = "Error",
2875
2825
  /** {zh}
2876
- * @brief 提示。
2826
+ * @brief 出现警告信息,通常由日志配置错误或缺少 RTM 降级地址引起。
2877
2827
  */
2878
2828
  /** {en}
2879
- * @brief Warn.
2829
+ * @brief A warning is issued, usually due to incorrect log configuration or a missing RTM fallback address.
2880
2830
  */
2881
2831
  Warn = "Warn"
2882
2832
  }
@@ -3333,7 +3283,6 @@ declare namespace strategy {
3333
3283
  showRefresh?: boolean;
3334
3284
  /** {zh}
3335
3285
  * @brief 自定义报错显示。
3336
- * @default 无
3337
3286
  */
3338
3287
  /** {en}
3339
3288
  * @brief Custom error message.
@@ -3342,7 +3291,6 @@ declare namespace strategy {
3342
3291
  errorTipsText?: string | Record<Lang, string>;
3343
3292
  /** {zh}
3344
3293
  * @brief 更多提示信息。
3345
- * @default 无
3346
3294
  */
3347
3295
  /** {en}
3348
3296
  * @brief More tips.
@@ -3502,7 +3450,6 @@ declare namespace strategy {
3502
3450
  id?: string;
3503
3451
  /** {zh}
3504
3452
  * @brief 指定播放器容器元素,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
3505
- * @default 无
3506
3453
  */
3507
3454
  /** {en}
3508
3455
  * @brief The container element of the player. You should specify either `id` or `el`, or both. If both are specified, the `VePlayer` object will be inserted in the container specified by `id`.
@@ -3528,7 +3475,6 @@ declare namespace strategy {
3528
3475
  height?: number | string;
3529
3476
  /** {zh}
3530
3477
  * @brief 为播放器配置直播拉流地址。您可手动拼接或使用地址生成器生成拉流地址,生成方法请参见[生成直播地址](https://www.volcengine.com/docs/6469/107759)。url 和 playList 需至少传入 1 个。
3531
- * @default 无
3532
3478
  */
3533
3479
  /** {en}
3534
3480
  * @brief The pull stream address. You can manually construct the address or use the address generator to generate one. To see how to generate an address, refer to [Generate live-stream addresses](https://docs.byteplus.com/en/byteplus-media-live/docs/generating-live-stream-addresses). You should specify either `url` or `playList`, or both.
@@ -3536,7 +3482,6 @@ declare namespace strategy {
3536
3482
  url?: string;
3537
3483
  /** {zh}
3538
3484
  * @brief 为播放器配置直播拉流地址列表。url 和 playlist 需至少传入 1 个。
3539
- * @default 无
3540
3485
  */
3541
3486
  /** {en}
3542
3487
  * @brief A list of live stream sources for the player. You should specify either `url` or `playList`, or both.
@@ -3544,7 +3489,6 @@ declare namespace strategy {
3544
3489
  playlist?: ExposedSource[];
3545
3490
  /** {zh}
3546
3491
  * @brief 当存在多个直播线路时,为播放器设置默认直播线路,不传则默认列表第一个。
3547
- * @default 无
3548
3492
  */
3549
3493
  /** {en}
3550
3494
  * @brief The default pull stream address for the player when there are multiple addresses available. If this parameter is not specified, the first address in the playlist will become the default address.
@@ -3552,7 +3496,6 @@ declare namespace strategy {
3552
3496
  defaultSource?: string;
3553
3497
  /** {zh}
3554
3498
  * @brief 为播放器设置默认直播清晰度,不传则默认列表第一个。
3555
- * @default 无
3556
3499
  */
3557
3500
  /** {en}
3558
3501
  * @brief The default resolution for the player when there are multiple resolutions available. If this parameter is not specified, the first resolution in the list will become the default resolution.
@@ -3560,7 +3503,6 @@ declare namespace strategy {
3560
3503
  defaultDefinition?: string;
3561
3504
  /** {zh}
3562
3505
  * @brief 为播放器设置备路拉流地址,支持设置多个备路拉流地址,在 `maxFallbackRound` 大于 `0` 时有效。当您使用配置的直播拉流地址拉流失败时,会在直播地址和备路直播地址之间循环拉流,直到拉流成功。
3563
- * @default 无
3564
3506
  */
3565
3507
  /** {en}
3566
3508
  * @brief The backup pull stream address(es) for the player. You can enter multiple backup addresses. If `maxFallbackRound` is greater than `0`, when an error occurs in the main address, the player automatically switches to the backup address.
@@ -3614,7 +3556,6 @@ declare namespace strategy {
3614
3556
  degradation?: Degradation | boolean;
3615
3557
  /** {zh}
3616
3558
  * @brief 为播放器设置封面图 URL。
3617
- * @default 无
3618
3559
  */
3619
3560
  /** {en}
3620
3561
  * @brief The URL of the player's cover image.
@@ -3630,7 +3571,6 @@ declare namespace strategy {
3630
3571
  /** {zh}
3631
3572
  * @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }。
3632
3573
  * 例如,{ texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }} ,格式请参考[默认词典](https://www.volcengine.com/docs/6469/127529)。
3633
- * @default 无
3634
3574
  */
3635
3575
  /** {en}
3636
3576
  * @brief Configures a custom multilingual dictionary for the player. You can set the dictionary for each language in the format { texts: { [key: string]: Object; } }. For example, { texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }}.
@@ -3640,7 +3580,7 @@ declare namespace strategy {
3640
3580
  texts: Record<Lang, Record<string, string>>;
3641
3581
  };
3642
3582
  /** {zh}
3643
- * @brief 为播放器设置是否自动播放, `muted` 设置为 `true` 为静音自动播放。
3583
+ * @brief 为播放器设置是否自动播放,`muted` 设置为 `true` 为静音自动播放。
3644
3584
  * @default { muted: true }
3645
3585
  * @type {{ muted: boolean } | boolean}
3646
3586
  */
@@ -3746,7 +3686,6 @@ declare namespace strategy {
3746
3686
  playsinline?: boolean;
3747
3687
  /** {zh}
3748
3688
  * @brief 为播放器设置 video 标签扩展属性,初始化时会设置在 videoElement 或 audioElement 对象上,请参考 [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) 查看其支持的属性配置。
3749
- * @default 无
3750
3689
  */
3751
3690
  /** {en}
3752
3691
  * @brief Additional properties for the `video` element that will be applied when the `videoElement` or `audioElement` objects are initialized. Refer to [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) for supported properties.
@@ -3824,7 +3763,6 @@ declare namespace strategy {
3824
3763
  marginControls?: boolean;
3825
3764
  /** {zh}
3826
3765
  * @brief 启用微信同层播放。
3827
- * @default 无
3828
3766
  */
3829
3767
  /** {en}
3830
3768
  * @brief Enable playing the video on the same player as WeChat.
@@ -3834,7 +3772,6 @@ declare namespace strategy {
3834
3772
  * @brief 是否启用微信全屏播放模式。
3835
3773
  * - `true`:启用
3836
3774
  * - `false`:停用
3837
- * @default 无
3838
3775
  */
3839
3776
  /** {en}
3840
3777
  * @brief Whether to enable full-screen playback in WeChat.
@@ -3847,7 +3784,6 @@ declare namespace strategy {
3847
3784
  * - `landscape`:横屏
3848
3785
  * - `portrait`:竖屏
3849
3786
  * - `landscape|portrait`:跟随手机自动旋转
3850
- * @default 无
3851
3787
  */
3852
3788
  /** {en}
3853
3789
  * @brief The orientation of the video when played on WeChat. The following values are supported:
@@ -3858,7 +3794,6 @@ declare namespace strategy {
3858
3794
  "x5-video-orientation"?: "landscape" | "portrait" | "landscape|portrait";
3859
3795
  /** {zh}
3860
3796
  * @brief 为播放器配置关键点样式。
3861
- * @default 无
3862
3797
  * @hidden 直播目前没用到
3863
3798
  */
3864
3799
  /** {en}
@@ -3868,7 +3803,6 @@ declare namespace strategy {
3868
3803
  commonStyle?: CommonStyle;
3869
3804
  /** {zh}
3870
3805
  * @brief 自定义插件列表。
3871
- * @default 无
3872
3806
  */
3873
3807
  /** {en}
3874
3808
  * @brief A list of custom plugins.
@@ -3911,10 +3845,10 @@ declare namespace strategy {
3911
3845
  */
3912
3846
  closeVideoDblclick?: boolean;
3913
3847
  /** {zh}
3914
- * @brief 支持传入 video dom,常应用于多播放器复用同一 video 场景。
3848
+ * @brief 支持传入 `video` DOM 元素,适用于多个播放器共享同一视频场景。
3915
3849
  */
3916
3850
  /** {en}
3917
- * @brief Supports passing in video DOM, commonly used for reusing the same video scene across multiple players.
3851
+ * @brief Supports passing in a `video` DOM element, suitable for scenarios where multiple players share the same video.
3918
3852
  */
3919
3853
  mediaElement?: HTMLVideoElement | null;
3920
3854
  }
@@ -3983,7 +3917,6 @@ declare namespace strategy {
3983
3917
  interface CommonStyle {
3984
3918
  /** {zh}
3985
3919
  * @brief 进度条底色。
3986
- * @default 无
3987
3920
  */
3988
3921
  /** {en}
3989
3922
  * @brief The background color of the progress bar.
@@ -3991,7 +3924,6 @@ declare namespace strategy {
3991
3924
  progressColor?: string;
3992
3925
  /** {zh}
3993
3926
  * @brief 播放完成部分进度条底色。
3994
- * @default 无
3995
3927
  */
3996
3928
  /** {en}
3997
3929
  * @brief The background color of the progress bar for the completed portion of video playback.
@@ -3999,7 +3931,6 @@ declare namespace strategy {
3999
3931
  playedColor?: string;
4000
3932
  /** {zh}
4001
3933
  * @brief 缓存部分进度条底色。
4002
- * @default 无
4003
3934
  */
4004
3935
  /** {en}
4005
3936
  * @brief
@@ -4008,7 +3939,6 @@ declare namespace strategy {
4008
3939
  cachedColor?: string;
4009
3940
  /** {zh}
4010
3941
  * @brief 进度条滑块样式。
4011
- * @default 无
4012
3942
  */
4013
3943
  /** {en}
4014
3944
  * @brief The style of the progress bar slider.
@@ -4019,7 +3949,6 @@ declare namespace strategy {
4019
3949
  };
4020
3950
  /** {zh}
4021
3951
  * @brief 音量颜色。
4022
- * @default 无
4023
3952
  */
4024
3953
  /** {en}
4025
3954
  * @brief The color of the volume slider.
@@ -4030,9 +3959,10 @@ declare namespace strategy {
4030
3959
  options?: Partial<VePlayerBaseOptions>;
4031
3960
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4032
3961
  plugins?: any[];
3962
+ protocol?: string;
4033
3963
  useSrc?: boolean;
4034
3964
  };
4035
- type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
3965
+ type PreparePlugins = (url?: string) => Promise<PrepareResult | undefined> | undefined;
4036
3966
  /** {zh}
4037
3967
  * @detail option
4038
3968
  * @brief 视频的实际编码格式。如果您在 degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
@@ -4212,13 +4142,6 @@ declare namespace strategy {
4212
4142
  function detectCodec(url: string): Promise<"unknown" | Codec>;
4213
4143
  function isSoftDecode(options: VePlayerBaseOptions, currentCodec?: Codec | "unknown"): Promise<boolean>;
4214
4144
  function combineOptions<T = VePlayerBaseOptions>(strategyList: (Strategy<T> | undefined)[]): Partial<T>;
4215
- const getHlsStrategy: (options: VePlayerBaseOptions) => Promise<{
4216
- options?: undefined;
4217
- plugins?: undefined;
4218
- } | {
4219
- options: Partial<VePlayerBaseOptions>;
4220
- plugins: any[];
4221
- }>;
4222
4145
  }
4223
4146
  declare function getStreamType(url: string): "unknown" | "hls" | "flv" | "rtm" | "mp4" | "dash";
4224
4147
  /** {zh}
@@ -4521,25 +4444,24 @@ declare namespace error {
4521
4444
  */
4522
4445
  enum Level {
4523
4446
  /** {zh}
4524
- * @brief 严重。
4447
+ * @brief 发生严重错误,可能由于 CDN 拉取失败或 DRM 权限验证未通过,导致无法播放。
4525
4448
  */
4526
4449
  /** {en}
4527
- * @brief Fatal.
4528
- *
4450
+ * @brief A critical error occurs, typically due to CDN fetching failure or DRM permission verification failure, resulting in playback inability.
4529
4451
  */
4530
4452
  Fatal = "Fatal",
4531
4453
  /** {zh}
4532
- * @brief 报错。
4454
+ * @brief 流异常或处于离线状态,致使播放失败。
4533
4455
  */
4534
4456
  /** {en}
4535
- * @brief Error.
4457
+ * @brief A stream anomaly or offline state causes playback to fail.
4536
4458
  */
4537
4459
  Error = "Error",
4538
4460
  /** {zh}
4539
- * @brief 提示。
4461
+ * @brief 出现警告信息,通常由日志配置错误或缺少 RTM 降级地址引起。
4540
4462
  */
4541
4463
  /** {en}
4542
- * @brief Warn.
4464
+ * @brief A warning is issued, usually due to incorrect log configuration or a missing RTM fallback address.
4543
4465
  */
4544
4466
  Warn = "Warn"
4545
4467
  }
@@ -5143,7 +5065,6 @@ declare class Sources extends OptionsIcon {
5143
5065
  };
5144
5066
  updateLang(): void;
5145
5067
  beforeCreate(args: XGPluginOptions): void;
5146
- afterCreate(): void;
5147
5068
  registerIcons(): {
5148
5069
  source: {
5149
5070
  icon: any;
@@ -5272,7 +5193,6 @@ interface LoggerConfig {
5272
5193
  enable?: boolean;
5273
5194
  /** {zh}
5274
5195
  * @brief 应用 ID,登录[视频直播控制台 > SDK 管理](https://console.volcengine.com/live/main/sdk)查询。
5275
- * @default 无
5276
5196
  */
5277
5197
  /** {en}
5278
5198
  * @brief The SDK application ID. You can access it by logging in to the BytePlus MediaLive console and navigating to [SDK Management](https://console.byteplus.com/live/main/sdk).
@@ -5280,7 +5200,6 @@ interface LoggerConfig {
5280
5200
  appId?: string;
5281
5201
  /** {zh}
5282
5202
  * @brief 应用名称。
5283
- * @default 无
5284
5203
  */
5285
5204
  /** {en}
5286
5205
  * @brief The application name.
@@ -5290,7 +5209,6 @@ interface LoggerConfig {
5290
5209
  * @brief 用于识别单一用户的 ID,如不设置,会随机生成一个用户 ID 存在浏览器缓存中。
5291
5210
  * @listtip
5292
5211
  * 建议您使用与业务相关的用户 ID,以便在发生播放错误时快速定位排查问题。
5293
- * @default 无
5294
5212
  */
5295
5213
  /** {en}
5296
5214
  * @brief The ID used to identify a single user. If not set, a random user ID will be generated and stored in the browser cache.
@@ -5302,7 +5220,6 @@ interface LoggerConfig {
5302
5220
  * @brief 用于识别用户设备的 ID,如不设置,会随机生成一个用户 ID 存在浏览器缓存中。
5303
5221
  * @listtip
5304
5222
  * 建议您使用与业务相关的用户设备 ID,以便在发生播放错误时快速定位排查问题。
5305
- * @default 无
5306
5223
  */
5307
5224
  /** {en}
5308
5225
  * @brief The ID used to identify a user's device. If not set, a random device ID will be generated and stored in the browser cache.
@@ -5320,6 +5237,88 @@ interface LoggerConfig {
5320
5237
  */
5321
5238
  showUserIdInErrorPanel?: boolean;
5322
5239
  }
5240
+ declare enum FallbackKind {
5241
+ Error = "Error",
5242
+ Stall = "Stall"
5243
+ }
5244
+ interface ErrorFallbackStrategy {
5245
+ type?: FallbackKind;
5246
+ excludeList?: ErrorCode[];
5247
+ shouldFallback?: (type: string, params: {
5248
+ error: VeError;
5249
+ }) => boolean;
5250
+ }
5251
+ interface StallFallbackStrategy {
5252
+ type?: FallbackKind;
5253
+ shouldFallback?: (type: string) => boolean;
5254
+ }
5255
+ // 播放类型抽象类 (BaseProtocol)
5256
+ declare abstract class BaseProtocol {
5257
+ // 下一个 protocol 类
5258
+ nextProtocol?: BaseProtocol;
5259
+ preProtocol?: BaseProtocol;
5260
+ protocolStrategy?: Strategy;
5261
+ private _fallback;
5262
+ constructor(options: VePlayerBaseOptions);
5263
+ // 当前播放类型
5264
+ abstract get protocolType(): string;
5265
+ abstract get defaultFallbackStrategy(): Partial<Record<FallbackKind, StallFallbackStrategy | ErrorFallbackStrategy>>;
5266
+ private _getKindFallbackStrategy;
5267
+ // eslint-disable-next-line @typescript-eslint/member-ordering
5268
+ get errorFallbackStrategy(): any;
5269
+ // eslint-disable-next-line @typescript-eslint/member-ordering
5270
+ get stallFallbackStrategy(): any;
5271
+ abstract shouldFallbackWhenStall(): boolean;
5272
+ // eslint-disable-next-line @typescript-eslint/member-ordering
5273
+ shouldFallbackWhenError(params: {
5274
+ error: VeError;
5275
+ }): any;
5276
+ // 是否支持播放
5277
+ abstract canPlay(): Promise<{
5278
+ canPlay: boolean;
5279
+ }>;
5280
+ abstract getProtocolStrategy(options: VePlayerBaseOptions, config?: {
5281
+ player?: VePlayerBase;
5282
+ i18n?: VeI18n;
5283
+ enableSelector?: boolean;
5284
+ }): Promise<Strategy> | undefined;
5285
+ abstract getDrmStrategy(options: VePlayerBaseOptions, player?: VePlayerBase): Promise<Strategy> | undefined;
5286
+ abstract getAbrStrategy(options: VePlayerBaseOptions): Promise<Strategy> | undefined;
5287
+ }
5288
+ type Strategy = {
5289
+ options?: undefined;
5290
+ plugins?: undefined;
5291
+ } | {
5292
+ options: Partial<VePlayerBaseOptions>;
5293
+ plugins: any[];
5294
+ };
5295
+ declare class ProtocolManager {
5296
+ private static _protocolMap;
5297
+ private _options;
5298
+ private _selector?;
5299
+ private _protocol;
5300
+ private _playlistMap;
5301
+ constructor(options: LiveVePlayerOptions);
5302
+ get enableSelector(): boolean;
5303
+ get protocol(): BaseProtocol | undefined;
5304
+ get playlist(): ExposedSource[] | undefined;
5305
+ static create(options: LiveVePlayerOptions): Promise<ProtocolManager>;
5306
+ private static _generateProtocolMap;
5307
+ getProtocol(): Promise<BaseProtocol | undefined>;
5308
+ update({ url, playlist }: {
5309
+ url?: string;
5310
+ playlist?: VePlayerBaseOptions["playlist"];
5311
+ }): Promise<void>;
5312
+ next(): Promise<BaseProtocol | undefined>;
5313
+ getStrategy(player: VePlayerBase | undefined, i18n: VeI18n): Promise<{
5314
+ options: Partial<VePlayerBaseOptions>;
5315
+ plugins: any[];
5316
+ useSrc: boolean;
5317
+ protocol: string | undefined;
5318
+ }>;
5319
+ private _init;
5320
+ private _initSingleProtocol;
5321
+ }
5323
5322
  /** {zh}
5324
5323
  * @list option
5325
5324
  * @kind property
@@ -5374,6 +5373,7 @@ interface LiveVePlayerOptions extends VePlayerBaseOptions {
5374
5373
  */
5375
5374
  /** {en}
5376
5375
  * @brief Configurations for advertising
5376
+ * @hidden
5377
5377
  */
5378
5378
  ad?: AdConfig;
5379
5379
  /** {zh}
@@ -5392,15 +5392,13 @@ interface LiveVePlayerOptions extends VePlayerBaseOptions {
5392
5392
  logger?: LoggerConfig;
5393
5393
  /** {zh}
5394
5394
  * @brief 为播放器禁用内置插件列表,接入方法请参见[插件说明](https://www.volcengine.com/docs/6469/192826#禁用插件)。
5395
- * @default 无
5396
5395
  */
5397
5396
  /** {en}
5398
5397
  * @brief A list of built-in plug-ins to be disabled. For the access method, please refer to [Plugin descriptions](https://docs.byteplus.com/en/docs/byteplus-media-live/docs-d8idjfeza4#disabling-plugins).
5399
5398
  */
5400
5399
  ignores?: string[];
5401
5400
  /** {zh}
5402
- * @brief 为播放器替换插件图标,接入方法请参见[插件说明](https://www.volcengine.com/docs/6469/192826#替换插件图标)。
5403
- * @default 无
5401
+ * @brief 为播放器替换插件图标,接入方法请参见[插件说明](https://www.volcengine.com/docs/6469/192826)。
5404
5402
  */
5405
5403
  /** {en}
5406
5404
  * @brief The plug-in icon. For the access method, please refer to [Plugin descriptions](https://docs.byteplus.com/en/docs/byteplus-media-live/docs-d8idjfeza4#replacing-plugin-icons).
@@ -5413,6 +5411,16 @@ interface LiveVePlayerOptions extends VePlayerBaseOptions {
5413
5411
  * @brief Digital Rights Management (DRM) configurations.
5414
5412
  */
5415
5413
  drm?: Drm;
5414
+ latencyMode?: "standard" | "low";
5415
+ fallback?: Fallback;
5416
+ }
5417
+ interface Fallback {
5418
+ enableFallback?: boolean;
5419
+ fallbackOrder?: string[];
5420
+ fallbackStrategy?: Record<string | "all", {
5421
+ [FallbackKind.Error]?: ErrorFallbackStrategy;
5422
+ [FallbackKind.Stall]?: StallFallbackStrategy;
5423
+ }>;
5416
5424
  }
5417
5425
  /** {zh}
5418
5426
  * @list option
@@ -5644,6 +5652,7 @@ interface TimeShiftConfig {
5644
5652
  * @list option
5645
5653
  * @kind property
5646
5654
  * @brief Advertising schedule for a single ad break
5655
+ * @hidden
5647
5656
  */
5648
5657
  interface AdRule {
5649
5658
  /** {en}
@@ -5665,6 +5674,7 @@ interface AdRule {
5665
5674
  * @list option
5666
5675
  * @kind property
5667
5676
  * @brief Configurations for Google IMA SDK
5677
+ * @hidden
5668
5678
  */
5669
5679
  interface ImaConfig {
5670
5680
  /** {en}
@@ -5687,6 +5697,7 @@ interface ImaConfig {
5687
5697
  * @list option
5688
5698
  * @kind property
5689
5699
  * @brief Configurations for advertising
5700
+ * @hidden
5690
5701
  */
5691
5702
  interface AdConfig {
5692
5703
  /** {en}
@@ -5737,7 +5748,8 @@ interface Rtm {
5737
5748
  * @brief 配置 RTM 拉流失败降级地址,可配置 FLV 拉流地址或 HLS 的拉流地址。`enableFallback` 为 `true` 时生效。
5738
5749
  * - 指定 `fallbackUrl`:当前环境不支持播放 RTM 或 RTM 拉流建联失败时,降级到 `fallbackUrl` 拉流地址。
5739
5750
  * - 未指定 `fallbackUrl`:当前环境不支持播放 RTM 或 RTM 拉流建联失败时,根据当前 RTM 地址降级到对应的 FLV 或者 HLS 地址。
5740
- * @default
5751
+ * @listtip - v2.5.2 版本后未指定 `fallbackUrl` 且未开启自动转码的情况下,不会自动降级到 FLV 或者 HLS 地址。
5752
+ * - 多线路和多清晰禁止插件内部自动降级, 具体降级方式查看 [RTM 拉流](https://www.volcengine.com/docs/6469/138655#rtm-%E6%8B%89%E6%B5%81)。
5741
5753
  */
5742
5754
  /** {en}
5743
5755
  * @brief The FLV or HLS addresses the player uses when failing to pull an RTM stream. This parameter takes effect when `enableFallback` is set to `true`.
@@ -5830,6 +5842,13 @@ interface Rtm {
5830
5842
  * @hidden
5831
5843
  */
5832
5844
  enableOriginSdpLogger?: boolean;
5845
+ /** {zh}
5846
+ * @brief RTM 协议缓冲区延迟,单位为秒。
5847
+ */
5848
+ /** {en}
5849
+ * @brief buffer delay to handle network jitter, in seconds。
5850
+ */
5851
+ delayHint?: number;
5833
5852
  }
5834
5853
  /** {zh}
5835
5854
  * @list option
@@ -5872,7 +5891,7 @@ interface Flv {
5872
5891
  * - `true`:开启;
5873
5892
  * - `false`:关闭
5874
5893
  * @default false
5875
- * @listtip 低延迟 FLV 拉流仅在 PC 端浏览器中生效。
5894
+ * @listtip v2.5.2 版本后支持 FLV H5 端低延迟拉流。
5876
5895
  */
5877
5896
  /** {en}
5878
5897
  * @brief Whether to enable low latency when playing an FLV address. For example, if you have enabled low latency, and set GOP to 2 seconds, the average latency will be around 2 seconds.
@@ -6043,7 +6062,7 @@ interface Hls {
6043
6062
  */
6044
6063
  interface RTMNetWorkInfo {
6045
6064
  /** {zh}
6046
- * @brief 最近一次网络评估周期内的下载速度, 单位为 bps。
6065
+ * @brief 最近一次网络评估周期内的下载速度,单位为 bps。
6047
6066
  */
6048
6067
  /** {en}
6049
6068
  * @brief The download speed within the latest network evaluation period, in units of bps.
@@ -6453,6 +6472,7 @@ interface FlvStats {
6453
6472
  * @inheritdoc
6454
6473
  */
6455
6474
  declare class VePlayerLive extends VePlayerBase {
6475
+ _protocolManager?: ProtocolManager;
6456
6476
  /** {zh}
6457
6477
  * @hidden
6458
6478
  * @param options
@@ -6469,6 +6489,12 @@ declare class VePlayerLive extends VePlayerBase {
6469
6489
  * @brief Obtain the duration that has been played, excluding pause and waiting time, with the unit of seconds.
6470
6490
  */
6471
6491
  get playTime(): number;
6492
+ /** {en}
6493
+ * @hidden
6494
+ */
6495
+ /** {zh}
6496
+ * @hidden
6497
+ */
6472
6498
  get ad(): any;
6473
6499
  /** {zh}
6474
6500
  * @brief 调用此方法开启直播日志上报。
@@ -6576,6 +6602,28 @@ declare class VePlayerLive extends VePlayerBase {
6576
6602
  * @brief Obtain the playback information of FLV pull streaming.
6577
6603
  */
6578
6604
  getFLVStats(): FlvStats;
6605
+ updatePlaylist(playlist: ExposedSource[], target?: string | {
6606
+ /** {zh}
6607
+ * @brief 清晰度唯一标识。
6608
+ * @default 无
6609
+ *
6610
+ */
6611
+ /** {en}
6612
+ * @brief The resolution ID.
6613
+ *
6614
+ */
6615
+ definition?: string;
6616
+ /** {zh}
6617
+ * @brief 线路的唯一标识。
6618
+ * @default 无
6619
+ *
6620
+ */
6621
+ /** {en}
6622
+ * @brief The playback resource ID.
6623
+ *
6624
+ */
6625
+ source?: string;
6626
+ }, needUpdateProtocol?: boolean): Promise<void>;
6579
6627
  }
6580
6628
  /** {zh}
6581
6629
  * @detail api
@@ -6823,25 +6871,24 @@ declare namespace live {
6823
6871
  */
6824
6872
  enum Level {
6825
6873
  /** {zh}
6826
- * @brief 严重。
6874
+ * @brief 发生严重错误,可能由于 CDN 拉取失败或 DRM 权限验证未通过,导致无法播放。
6827
6875
  */
6828
6876
  /** {en}
6829
- * @brief Fatal.
6830
- *
6877
+ * @brief A critical error occurs, typically due to CDN fetching failure or DRM permission verification failure, resulting in playback inability.
6831
6878
  */
6832
6879
  Fatal = "Fatal",
6833
6880
  /** {zh}
6834
- * @brief 报错。
6881
+ * @brief 流异常或处于离线状态,致使播放失败。
6835
6882
  */
6836
6883
  /** {en}
6837
- * @brief Error.
6884
+ * @brief A stream anomaly or offline state causes playback to fail.
6838
6885
  */
6839
6886
  Error = "Error",
6840
6887
  /** {zh}
6841
- * @brief 提示。
6888
+ * @brief 出现警告信息,通常由日志配置错误或缺少 RTM 降级地址引起。
6842
6889
  */
6843
6890
  /** {en}
6844
- * @brief Warn.
6891
+ * @brief A warning is issued, usually due to incorrect log configuration or a missing RTM fallback address.
6845
6892
  */
6846
6893
  Warn = "Warn"
6847
6894
  }
@@ -7265,8 +7312,8 @@ declare namespace live {
7265
7312
  next: DefinitionUrl | null;
7266
7313
  }
7267
7314
  function arrayToList(urls?: string[]): DefinitionUrl;
7268
- class Definition implements XGDefinition {
7269
- readonly definition: string;
7315
+ class Definition {
7316
+ readonly definition?: string;
7270
7317
  readonly source: Source;
7271
7318
  readonly text?: Record<Lang, string> | string;
7272
7319
  readonly fallbackUrl: DefinitionUrl;
@@ -7274,7 +7321,7 @@ declare namespace live {
7274
7321
  private _currentUrlRef;
7275
7322
  constructor(definitionSetting: {
7276
7323
  url: string;
7277
- definition: string;
7324
+ definition?: string;
7278
7325
  source: Source;
7279
7326
  text?: Record<Lang, string> | string;
7280
7327
  fallbackUrls?: string[];
@@ -7300,7 +7347,6 @@ declare namespace live {
7300
7347
  interface ExposedDefinition {
7301
7348
  /** {zh}
7302
7349
  * @brief 播放地址。
7303
- * @default 无
7304
7350
  */
7305
7351
  /** {en}
7306
7352
  * @brief The playback address.
@@ -7308,17 +7354,14 @@ declare namespace live {
7308
7354
  url: string;
7309
7355
  /** {zh}
7310
7356
  * @brief 清晰度标识(唯一值)。
7311
- * @default 无
7312
- *
7313
7357
  */
7314
7358
  /** {en}
7315
7359
  * @brief The resolution ID. This value must be unique.
7316
7360
  *
7317
7361
  */
7318
- definition: string;
7362
+ definition?: string;
7319
7363
  /** {zh}
7320
7364
  * @brief 清晰度展示名称。可设置多语言 `{text: {'zh-cn': '高清', 'en': 'HD'}}`。
7321
- * @default 无
7322
7365
  */
7323
7366
  /** {en}
7324
7367
  * @brief The display name of the resolution. Multiple languages are supported, such as `{text: {'zh-cn': '高清', 'en': 'HD'}}`.
@@ -7326,14 +7369,13 @@ declare namespace live {
7326
7369
  text?: Record<Lang, string> | string;
7327
7370
  /** {zh}
7328
7371
  * @brief 为当前清晰度地址设置备路拉流地址,支持设置多个备路拉流地址。当前清晰度地址拉流失败时,会在当前清晰度地址和备路直播地址之间循环拉流,直到拉流成功。
7329
- * @default 无
7330
- *
7331
7372
  */
7332
7373
  /** {en}
7333
7374
  * @brief The backup pull stream address for the current resolution. You can set multiple backup addresses. When the player fails to pull a stream from the current address, it will loop between the current and the backup addresses until it successfully pulls a stream.
7334
7375
  *
7335
7376
  */
7336
7377
  fallbackUrls?: string[];
7378
+ type?: string;
7337
7379
  }
7338
7380
  /** {zh}
7339
7381
  * @list option
@@ -7350,7 +7392,6 @@ declare namespace live {
7350
7392
  interface ExposedSource {
7351
7393
  /** {zh}
7352
7394
  * @brief 线路标识(唯一值)。
7353
- * @default 无
7354
7395
  */
7355
7396
  /** {en}
7356
7397
  * @brief The playback source ID. This value must be unique.
@@ -7358,8 +7399,6 @@ declare namespace live {
7358
7399
  name?: string;
7359
7400
  /** {zh}
7360
7401
  * @brief 线路展示名称。可设置多语言 `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`。
7361
- * @default 无
7362
- *
7363
7402
  */
7364
7403
  /** {en}
7365
7404
  * @brief The display name of the live stream source. Multiple languages are supported. For example, you set it to `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`.
@@ -7368,8 +7407,6 @@ declare namespace live {
7368
7407
  text?: Record<Lang, string> | string;
7369
7408
  /** {zh}
7370
7409
  * @brief 该线路下清晰度列表。
7371
- * @default 无
7372
- *
7373
7410
  */
7374
7411
  /** {en}
7375
7412
  * @brief A list of resolutions of the current source.
@@ -7912,7 +7949,7 @@ declare namespace live {
7912
7949
  */
7913
7950
  autoHide: boolean;
7914
7951
  /** {zh}
7915
- * @brief 自动隐藏的延迟时间, 单位为 ms。
7952
+ * @brief 自动隐藏的延迟时间,单位为 ms。
7916
7953
  */
7917
7954
  /** {en}
7918
7955
  * @brief The latency of auto hiding, in milliseconds.
@@ -8651,7 +8688,6 @@ declare namespace live {
8651
8688
  showRefresh?: boolean;
8652
8689
  /** {zh}
8653
8690
  * @brief 自定义报错显示。
8654
- * @default 无
8655
8691
  */
8656
8692
  /** {en}
8657
8693
  * @brief Custom error message.
@@ -8660,7 +8696,6 @@ declare namespace live {
8660
8696
  errorTipsText?: string | Record<Lang, string>;
8661
8697
  /** {zh}
8662
8698
  * @brief 更多提示信息。
8663
- * @default 无
8664
8699
  */
8665
8700
  /** {en}
8666
8701
  * @brief More tips.
@@ -8820,7 +8855,6 @@ declare namespace live {
8820
8855
  id?: string;
8821
8856
  /** {zh}
8822
8857
  * @brief 指定播放器容器元素,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
8823
- * @default 无
8824
8858
  */
8825
8859
  /** {en}
8826
8860
  * @brief The container element of the player. You should specify either `id` or `el`, or both. If both are specified, the `VePlayer` object will be inserted in the container specified by `id`.
@@ -8846,7 +8880,6 @@ declare namespace live {
8846
8880
  height?: number | string;
8847
8881
  /** {zh}
8848
8882
  * @brief 为播放器配置直播拉流地址。您可手动拼接或使用地址生成器生成拉流地址,生成方法请参见[生成直播地址](https://www.volcengine.com/docs/6469/107759)。url 和 playList 需至少传入 1 个。
8849
- * @default 无
8850
8883
  */
8851
8884
  /** {en}
8852
8885
  * @brief The pull stream address. You can manually construct the address or use the address generator to generate one. To see how to generate an address, refer to [Generate live-stream addresses](https://docs.byteplus.com/en/byteplus-media-live/docs/generating-live-stream-addresses). You should specify either `url` or `playList`, or both.
@@ -8854,7 +8887,6 @@ declare namespace live {
8854
8887
  url?: string;
8855
8888
  /** {zh}
8856
8889
  * @brief 为播放器配置直播拉流地址列表。url 和 playlist 需至少传入 1 个。
8857
- * @default 无
8858
8890
  */
8859
8891
  /** {en}
8860
8892
  * @brief A list of live stream sources for the player. You should specify either `url` or `playList`, or both.
@@ -8862,7 +8894,6 @@ declare namespace live {
8862
8894
  playlist?: ExposedSource[];
8863
8895
  /** {zh}
8864
8896
  * @brief 当存在多个直播线路时,为播放器设置默认直播线路,不传则默认列表第一个。
8865
- * @default 无
8866
8897
  */
8867
8898
  /** {en}
8868
8899
  * @brief The default pull stream address for the player when there are multiple addresses available. If this parameter is not specified, the first address in the playlist will become the default address.
@@ -8870,7 +8901,6 @@ declare namespace live {
8870
8901
  defaultSource?: string;
8871
8902
  /** {zh}
8872
8903
  * @brief 为播放器设置默认直播清晰度,不传则默认列表第一个。
8873
- * @default 无
8874
8904
  */
8875
8905
  /** {en}
8876
8906
  * @brief The default resolution for the player when there are multiple resolutions available. If this parameter is not specified, the first resolution in the list will become the default resolution.
@@ -8878,7 +8908,6 @@ declare namespace live {
8878
8908
  defaultDefinition?: string;
8879
8909
  /** {zh}
8880
8910
  * @brief 为播放器设置备路拉流地址,支持设置多个备路拉流地址,在 `maxFallbackRound` 大于 `0` 时有效。当您使用配置的直播拉流地址拉流失败时,会在直播地址和备路直播地址之间循环拉流,直到拉流成功。
8881
- * @default 无
8882
8911
  */
8883
8912
  /** {en}
8884
8913
  * @brief The backup pull stream address(es) for the player. You can enter multiple backup addresses. If `maxFallbackRound` is greater than `0`, when an error occurs in the main address, the player automatically switches to the backup address.
@@ -8932,7 +8961,6 @@ declare namespace live {
8932
8961
  degradation?: Degradation | boolean;
8933
8962
  /** {zh}
8934
8963
  * @brief 为播放器设置封面图 URL。
8935
- * @default 无
8936
8964
  */
8937
8965
  /** {en}
8938
8966
  * @brief The URL of the player's cover image.
@@ -8948,7 +8976,6 @@ declare namespace live {
8948
8976
  /** {zh}
8949
8977
  * @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }。
8950
8978
  * 例如,{ texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }} ,格式请参考[默认词典](https://www.volcengine.com/docs/6469/127529)。
8951
- * @default 无
8952
8979
  */
8953
8980
  /** {en}
8954
8981
  * @brief Configures a custom multilingual dictionary for the player. You can set the dictionary for each language in the format { texts: { [key: string]: Object; } }. For example, { texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }}.
@@ -8958,7 +8985,7 @@ declare namespace live {
8958
8985
  texts: Record<Lang, Record<string, string>>;
8959
8986
  };
8960
8987
  /** {zh}
8961
- * @brief 为播放器设置是否自动播放, `muted` 设置为 `true` 为静音自动播放。
8988
+ * @brief 为播放器设置是否自动播放,`muted` 设置为 `true` 为静音自动播放。
8962
8989
  * @default { muted: true }
8963
8990
  * @type {{ muted: boolean } | boolean}
8964
8991
  */
@@ -9064,7 +9091,6 @@ declare namespace live {
9064
9091
  playsinline?: boolean;
9065
9092
  /** {zh}
9066
9093
  * @brief 为播放器设置 video 标签扩展属性,初始化时会设置在 videoElement 或 audioElement 对象上,请参考 [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) 查看其支持的属性配置。
9067
- * @default 无
9068
9094
  */
9069
9095
  /** {en}
9070
9096
  * @brief Additional properties for the `video` element that will be applied when the `videoElement` or `audioElement` objects are initialized. Refer to [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) for supported properties.
@@ -9142,7 +9168,6 @@ declare namespace live {
9142
9168
  marginControls?: boolean;
9143
9169
  /** {zh}
9144
9170
  * @brief 启用微信同层播放。
9145
- * @default 无
9146
9171
  */
9147
9172
  /** {en}
9148
9173
  * @brief Enable playing the video on the same player as WeChat.
@@ -9152,7 +9177,6 @@ declare namespace live {
9152
9177
  * @brief 是否启用微信全屏播放模式。
9153
9178
  * - `true`:启用
9154
9179
  * - `false`:停用
9155
- * @default 无
9156
9180
  */
9157
9181
  /** {en}
9158
9182
  * @brief Whether to enable full-screen playback in WeChat.
@@ -9165,7 +9189,6 @@ declare namespace live {
9165
9189
  * - `landscape`:横屏
9166
9190
  * - `portrait`:竖屏
9167
9191
  * - `landscape|portrait`:跟随手机自动旋转
9168
- * @default 无
9169
9192
  */
9170
9193
  /** {en}
9171
9194
  * @brief The orientation of the video when played on WeChat. The following values are supported:
@@ -9176,7 +9199,6 @@ declare namespace live {
9176
9199
  "x5-video-orientation"?: "landscape" | "portrait" | "landscape|portrait";
9177
9200
  /** {zh}
9178
9201
  * @brief 为播放器配置关键点样式。
9179
- * @default 无
9180
9202
  * @hidden 直播目前没用到
9181
9203
  */
9182
9204
  /** {en}
@@ -9186,7 +9208,6 @@ declare namespace live {
9186
9208
  commonStyle?: CommonStyle;
9187
9209
  /** {zh}
9188
9210
  * @brief 自定义插件列表。
9189
- * @default 无
9190
9211
  */
9191
9212
  /** {en}
9192
9213
  * @brief A list of custom plugins.
@@ -9229,10 +9250,10 @@ declare namespace live {
9229
9250
  */
9230
9251
  closeVideoDblclick?: boolean;
9231
9252
  /** {zh}
9232
- * @brief 支持传入 video dom,常应用于多播放器复用同一 video 场景。
9253
+ * @brief 支持传入 `video` DOM 元素,适用于多个播放器共享同一视频场景。
9233
9254
  */
9234
9255
  /** {en}
9235
- * @brief Supports passing in video DOM, commonly used for reusing the same video scene across multiple players.
9256
+ * @brief Supports passing in a `video` DOM element, suitable for scenarios where multiple players share the same video.
9236
9257
  */
9237
9258
  mediaElement?: HTMLVideoElement | null;
9238
9259
  }
@@ -9301,7 +9322,6 @@ declare namespace live {
9301
9322
  interface CommonStyle {
9302
9323
  /** {zh}
9303
9324
  * @brief 进度条底色。
9304
- * @default 无
9305
9325
  */
9306
9326
  /** {en}
9307
9327
  * @brief The background color of the progress bar.
@@ -9309,7 +9329,6 @@ declare namespace live {
9309
9329
  progressColor?: string;
9310
9330
  /** {zh}
9311
9331
  * @brief 播放完成部分进度条底色。
9312
- * @default 无
9313
9332
  */
9314
9333
  /** {en}
9315
9334
  * @brief The background color of the progress bar for the completed portion of video playback.
@@ -9317,7 +9336,6 @@ declare namespace live {
9317
9336
  playedColor?: string;
9318
9337
  /** {zh}
9319
9338
  * @brief 缓存部分进度条底色。
9320
- * @default 无
9321
9339
  */
9322
9340
  /** {en}
9323
9341
  * @brief
@@ -9326,7 +9344,6 @@ declare namespace live {
9326
9344
  cachedColor?: string;
9327
9345
  /** {zh}
9328
9346
  * @brief 进度条滑块样式。
9329
- * @default 无
9330
9347
  */
9331
9348
  /** {en}
9332
9349
  * @brief The style of the progress bar slider.
@@ -9337,7 +9354,6 @@ declare namespace live {
9337
9354
  };
9338
9355
  /** {zh}
9339
9356
  * @brief 音量颜色。
9340
- * @default 无
9341
9357
  */
9342
9358
  /** {en}
9343
9359
  * @brief The color of the volume slider.
@@ -9348,9 +9364,10 @@ declare namespace live {
9348
9364
  options?: Partial<VePlayerBaseOptions>;
9349
9365
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9350
9366
  plugins?: any[];
9367
+ protocol?: string;
9351
9368
  useSrc?: boolean;
9352
9369
  };
9353
- type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
9370
+ type PreparePlugins = (url?: string) => Promise<PrepareResult | undefined> | undefined;
9354
9371
  /** {zh}
9355
9372
  * @detail option
9356
9373
  * @brief 视频的实际编码格式。如果您在 degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
@@ -9475,6 +9492,7 @@ declare namespace live {
9475
9492
  private _events;
9476
9493
  private _customMedia?;
9477
9494
  private _errorCallback;
9495
+ private _beforeFallbackError;
9478
9496
  /** {zh}
9479
9497
  * @hidden
9480
9498
  */
@@ -9514,7 +9532,7 @@ declare namespace live {
9514
9532
  */
9515
9533
  get played(): TimeRanges;
9516
9534
  /** {zh}
9517
- * @brief 设置/获取视频当前的播放时间, 单位为 s。
9535
+ * @brief 设置/获取视频当前的播放时间,单位为 s。
9518
9536
  */
9519
9537
  /** {en}
9520
9538
  * @brief Sets or gets the current playback position of the video, in seconds.
@@ -9625,7 +9643,7 @@ declare namespace live {
9625
9643
  /** {en}
9626
9644
  * @brief Gets the current resolution ID.
9627
9645
  */
9628
- get definition(): string;
9646
+ get definition(): string | undefined;
9629
9647
  /** {zh}
9630
9648
  * @brief 获取和设置播放器的跨域配置信息,更多信息参考 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性介绍。
9631
9649
  */
@@ -9715,7 +9733,6 @@ declare namespace live {
9715
9733
  switch(target: string | {
9716
9734
  /** {zh}
9717
9735
  * @brief 清晰度的唯一标识。
9718
- * @default 无
9719
9736
  */
9720
9737
  /** {en}
9721
9738
  * @brief The resolution ID.
@@ -9723,7 +9740,6 @@ declare namespace live {
9723
9740
  definition?: string;
9724
9741
  /** {zh}
9725
9742
  * @brief 线路的唯一标识。
9726
- * @default 无
9727
9743
  */
9728
9744
  /** {en}
9729
9745
  * @brief The playback source ID.
@@ -9763,8 +9779,6 @@ declare namespace live {
9763
9779
  updatePlaylist(playlist: ExposedSource[] | string, target?: string | {
9764
9780
  /** {zh}
9765
9781
  * @brief 清晰度唯一标识。
9766
- * @default 无
9767
- *
9768
9782
  */
9769
9783
  /** {en}
9770
9784
  * @brief The resolution ID.
@@ -9773,8 +9787,6 @@ declare namespace live {
9773
9787
  definition?: string;
9774
9788
  /** {zh}
9775
9789
  * @brief 线路的唯一标识。
9776
- * @default 无
9777
- *
9778
9790
  */
9779
9791
  /** {en}
9780
9792
  * @brief The playback resource ID.
@@ -9975,7 +9987,6 @@ declare namespace live {
9975
9987
  Function | {
9976
9988
  /** {zh}
9977
9989
  * @brief 插件构造函数。
9978
- * @default 无
9979
9990
  */
9980
9991
  /** {en}
9981
9992
  * @brief The plugin constructor.
@@ -9984,7 +9995,6 @@ declare namespace live {
9984
9995
  plugin: Function;
9985
9996
  /** {zh}
9986
9997
  * @brief 插件配置参数。
9987
- * @default 无
9988
9998
  */
9989
9999
  /** {en}
9990
10000
  * @brief The plugin configurations.
@@ -10339,7 +10349,6 @@ declare namespace live {
10339
10349
  };
10340
10350
  updateLang(): void;
10341
10351
  beforeCreate(args: XGPluginOptions): void;
10342
- afterCreate(): void;
10343
10352
  registerIcons(): {
10344
10353
  source: {
10345
10354
  icon: any;
@@ -10617,7 +10626,7 @@ declare namespace live {
10617
10626
  EMPTY_RTM_FALLBACK_PARAMETER = 211,
10618
10627
  /** {zh}
10619
10628
  * @brief 日志错误
10620
- * @solution 未正确配置质量日志参数, 请参考 https://www.volcengine.com/docs/6469/138655#日志上报 配置。
10629
+ * @solution 未正确配置质量日志参数,请参考 https://www.volcengine.com/docs/6469/138655#日志上报 配置。
10621
10630
  */
10622
10631
  /** {en}
10623
10632
  * @brief Log errors.
@@ -10783,7 +10792,6 @@ declare namespace live {
10783
10792
  enable?: boolean;
10784
10793
  /** {zh}
10785
10794
  * @brief 应用 ID,登录[视频直播控制台 > SDK 管理](https://console.volcengine.com/live/main/sdk)查询。
10786
- * @default 无
10787
10795
  */
10788
10796
  /** {en}
10789
10797
  * @brief The SDK application ID. You can access it by logging in to the BytePlus MediaLive console and navigating to [SDK Management](https://console.byteplus.com/live/main/sdk).
@@ -10791,7 +10799,6 @@ declare namespace live {
10791
10799
  appId?: string;
10792
10800
  /** {zh}
10793
10801
  * @brief 应用名称。
10794
- * @default 无
10795
10802
  */
10796
10803
  /** {en}
10797
10804
  * @brief The application name.
@@ -10801,7 +10808,6 @@ declare namespace live {
10801
10808
  * @brief 用于识别单一用户的 ID,如不设置,会随机生成一个用户 ID 存在浏览器缓存中。
10802
10809
  * @listtip
10803
10810
  * 建议您使用与业务相关的用户 ID,以便在发生播放错误时快速定位排查问题。
10804
- * @default 无
10805
10811
  */
10806
10812
  /** {en}
10807
10813
  * @brief The ID used to identify a single user. If not set, a random user ID will be generated and stored in the browser cache.
@@ -10813,7 +10819,6 @@ declare namespace live {
10813
10819
  * @brief 用于识别用户设备的 ID,如不设置,会随机生成一个用户 ID 存在浏览器缓存中。
10814
10820
  * @listtip
10815
10821
  * 建议您使用与业务相关的用户设备 ID,以便在发生播放错误时快速定位排查问题。
10816
- * @default 无
10817
10822
  */
10818
10823
  /** {en}
10819
10824
  * @brief The ID used to identify a user's device. If not set, a random device ID will be generated and stored in the browser cache.
@@ -10852,6 +10857,88 @@ declare namespace live {
10852
10857
  private _createTea;
10853
10858
  private _start;
10854
10859
  }
10860
+ enum FallbackKind {
10861
+ Error = "Error",
10862
+ Stall = "Stall"
10863
+ }
10864
+ interface ErrorFallbackStrategy {
10865
+ type?: FallbackKind;
10866
+ excludeList?: ErrorCode$0[];
10867
+ shouldFallback?: (type: string, params: {
10868
+ error: VeError$1;
10869
+ }) => boolean;
10870
+ }
10871
+ interface StallFallbackStrategy {
10872
+ type?: FallbackKind;
10873
+ shouldFallback?: (type: string) => boolean;
10874
+ }
10875
+ // 播放类型抽象类 (BaseProtocol)
10876
+ abstract class BaseProtocol {
10877
+ // 下一个 protocol 类
10878
+ nextProtocol?: BaseProtocol;
10879
+ preProtocol?: BaseProtocol;
10880
+ protocolStrategy?: Strategy;
10881
+ private _fallback;
10882
+ constructor(options: VePlayerBaseOptions);
10883
+ // 当前播放类型
10884
+ abstract get protocolType(): string;
10885
+ abstract get defaultFallbackStrategy(): Partial<Record<FallbackKind, StallFallbackStrategy | ErrorFallbackStrategy>>;
10886
+ private _getKindFallbackStrategy;
10887
+ // eslint-disable-next-line @typescript-eslint/member-ordering
10888
+ get errorFallbackStrategy(): any;
10889
+ // eslint-disable-next-line @typescript-eslint/member-ordering
10890
+ get stallFallbackStrategy(): any;
10891
+ abstract shouldFallbackWhenStall(): boolean;
10892
+ // eslint-disable-next-line @typescript-eslint/member-ordering
10893
+ shouldFallbackWhenError(params: {
10894
+ error: VeError$1;
10895
+ }): any;
10896
+ // 是否支持播放
10897
+ abstract canPlay(): Promise<{
10898
+ canPlay: boolean;
10899
+ }>;
10900
+ abstract getProtocolStrategy(options: VePlayerBaseOptions, config?: {
10901
+ player?: VePlayerBase;
10902
+ i18n?: VeI18n;
10903
+ enableSelector?: boolean;
10904
+ }): Promise<Strategy> | undefined;
10905
+ abstract getDrmStrategy(options: VePlayerBaseOptions, player?: VePlayerBase): Promise<Strategy> | undefined;
10906
+ abstract getAbrStrategy(options: VePlayerBaseOptions): Promise<Strategy> | undefined;
10907
+ }
10908
+ type Strategy = {
10909
+ options?: undefined;
10910
+ plugins?: undefined;
10911
+ } | {
10912
+ options: Partial<VePlayerBaseOptions>;
10913
+ plugins: any[];
10914
+ };
10915
+ class ProtocolManager {
10916
+ private static _protocolMap;
10917
+ private _options;
10918
+ private _selector?;
10919
+ private _protocol;
10920
+ private _playlistMap;
10921
+ constructor(options: LiveVePlayerOptions);
10922
+ get enableSelector(): boolean;
10923
+ get protocol(): BaseProtocol | undefined;
10924
+ get playlist(): ExposedSource[] | undefined;
10925
+ static create(options: LiveVePlayerOptions): Promise<ProtocolManager>;
10926
+ private static _generateProtocolMap;
10927
+ getProtocol(): Promise<BaseProtocol | undefined>;
10928
+ update({ url, playlist }: {
10929
+ url?: string;
10930
+ playlist?: VePlayerBaseOptions["playlist"];
10931
+ }): Promise<void>;
10932
+ next(): Promise<BaseProtocol | undefined>;
10933
+ getStrategy(player: VePlayerBase | undefined, i18n: VeI18n): Promise<{
10934
+ options: Partial<VePlayerBaseOptions>;
10935
+ plugins: any[];
10936
+ useSrc: boolean;
10937
+ protocol: string | undefined;
10938
+ }>;
10939
+ private _init;
10940
+ private _initSingleProtocol;
10941
+ }
10855
10942
  /** {zh}
10856
10943
  * @list option
10857
10944
  * @kind property
@@ -10906,6 +10993,7 @@ declare namespace live {
10906
10993
  */
10907
10994
  /** {en}
10908
10995
  * @brief Configurations for advertising
10996
+ * @hidden
10909
10997
  */
10910
10998
  ad?: AdConfig;
10911
10999
  /** {zh}
@@ -10924,15 +11012,13 @@ declare namespace live {
10924
11012
  logger?: LoggerConfig;
10925
11013
  /** {zh}
10926
11014
  * @brief 为播放器禁用内置插件列表,接入方法请参见[插件说明](https://www.volcengine.com/docs/6469/192826#禁用插件)。
10927
- * @default 无
10928
11015
  */
10929
11016
  /** {en}
10930
11017
  * @brief A list of built-in plug-ins to be disabled. For the access method, please refer to [Plugin descriptions](https://docs.byteplus.com/en/docs/byteplus-media-live/docs-d8idjfeza4#disabling-plugins).
10931
11018
  */
10932
11019
  ignores?: string[];
10933
11020
  /** {zh}
10934
- * @brief 为播放器替换插件图标,接入方法请参见[插件说明](https://www.volcengine.com/docs/6469/192826#替换插件图标)。
10935
- * @default 无
11021
+ * @brief 为播放器替换插件图标,接入方法请参见[插件说明](https://www.volcengine.com/docs/6469/192826)。
10936
11022
  */
10937
11023
  /** {en}
10938
11024
  * @brief The plug-in icon. For the access method, please refer to [Plugin descriptions](https://docs.byteplus.com/en/docs/byteplus-media-live/docs-d8idjfeza4#replacing-plugin-icons).
@@ -10945,6 +11031,16 @@ declare namespace live {
10945
11031
  * @brief Digital Rights Management (DRM) configurations.
10946
11032
  */
10947
11033
  drm?: Drm;
11034
+ latencyMode?: "standard" | "low";
11035
+ fallback?: Fallback;
11036
+ }
11037
+ interface Fallback {
11038
+ enableFallback?: boolean;
11039
+ fallbackOrder?: string[];
11040
+ fallbackStrategy?: Record<string | "all", {
11041
+ [FallbackKind.Error]?: ErrorFallbackStrategy;
11042
+ [FallbackKind.Stall]?: StallFallbackStrategy;
11043
+ }>;
10948
11044
  }
10949
11045
  /** {zh}
10950
11046
  * @list option
@@ -11176,6 +11272,7 @@ declare namespace live {
11176
11272
  * @list option
11177
11273
  * @kind property
11178
11274
  * @brief Advertising schedule for a single ad break
11275
+ * @hidden
11179
11276
  */
11180
11277
  interface AdRule {
11181
11278
  /** {en}
@@ -11197,6 +11294,7 @@ declare namespace live {
11197
11294
  * @list option
11198
11295
  * @kind property
11199
11296
  * @brief Configurations for Google IMA SDK
11297
+ * @hidden
11200
11298
  */
11201
11299
  interface ImaConfig {
11202
11300
  /** {en}
@@ -11219,6 +11317,7 @@ declare namespace live {
11219
11317
  * @list option
11220
11318
  * @kind property
11221
11319
  * @brief Configurations for advertising
11320
+ * @hidden
11222
11321
  */
11223
11322
  interface AdConfig {
11224
11323
  /** {en}
@@ -11269,7 +11368,8 @@ declare namespace live {
11269
11368
  * @brief 配置 RTM 拉流失败降级地址,可配置 FLV 拉流地址或 HLS 的拉流地址。`enableFallback` 为 `true` 时生效。
11270
11369
  * - 指定 `fallbackUrl`:当前环境不支持播放 RTM 或 RTM 拉流建联失败时,降级到 `fallbackUrl` 拉流地址。
11271
11370
  * - 未指定 `fallbackUrl`:当前环境不支持播放 RTM 或 RTM 拉流建联失败时,根据当前 RTM 地址降级到对应的 FLV 或者 HLS 地址。
11272
- * @default
11371
+ * @listtip - v2.5.2 版本后未指定 `fallbackUrl` 且未开启自动转码的情况下,不会自动降级到 FLV 或者 HLS 地址。
11372
+ * - 多线路和多清晰禁止插件内部自动降级, 具体降级方式查看 [RTM 拉流](https://www.volcengine.com/docs/6469/138655#rtm-%E6%8B%89%E6%B5%81)。
11273
11373
  */
11274
11374
  /** {en}
11275
11375
  * @brief The FLV or HLS addresses the player uses when failing to pull an RTM stream. This parameter takes effect when `enableFallback` is set to `true`.
@@ -11362,6 +11462,13 @@ declare namespace live {
11362
11462
  * @hidden
11363
11463
  */
11364
11464
  enableOriginSdpLogger?: boolean;
11465
+ /** {zh}
11466
+ * @brief RTM 协议缓冲区延迟,单位为秒。
11467
+ */
11468
+ /** {en}
11469
+ * @brief buffer delay to handle network jitter, in seconds。
11470
+ */
11471
+ delayHint?: number;
11365
11472
  }
11366
11473
  /** {zh}
11367
11474
  * @list option
@@ -11404,7 +11511,7 @@ declare namespace live {
11404
11511
  * - `true`:开启;
11405
11512
  * - `false`:关闭
11406
11513
  * @default false
11407
- * @listtip 低延迟 FLV 拉流仅在 PC 端浏览器中生效。
11514
+ * @listtip v2.5.2 版本后支持 FLV H5 端低延迟拉流。
11408
11515
  */
11409
11516
  /** {en}
11410
11517
  * @brief Whether to enable low latency when playing an FLV address. For example, if you have enabled low latency, and set GOP to 2 seconds, the average latency will be around 2 seconds.
@@ -11575,7 +11682,7 @@ declare namespace live {
11575
11682
  */
11576
11683
  interface RTMNetWorkInfo {
11577
11684
  /** {zh}
11578
- * @brief 最近一次网络评估周期内的下载速度, 单位为 bps。
11685
+ * @brief 最近一次网络评估周期内的下载速度,单位为 bps。
11579
11686
  */
11580
11687
  /** {en}
11581
11688
  * @brief The download speed within the latest network evaluation period, in units of bps.
@@ -11985,6 +12092,7 @@ declare namespace live {
11985
12092
  * @inheritdoc
11986
12093
  */
11987
12094
  class VePlayerLive extends VePlayerBase {
12095
+ _protocolManager?: ProtocolManager;
11988
12096
  /** {zh}
11989
12097
  * @hidden
11990
12098
  * @param options
@@ -12001,6 +12109,12 @@ declare namespace live {
12001
12109
  * @brief Obtain the duration that has been played, excluding pause and waiting time, with the unit of seconds.
12002
12110
  */
12003
12111
  get playTime(): number;
12112
+ /** {en}
12113
+ * @hidden
12114
+ */
12115
+ /** {zh}
12116
+ * @hidden
12117
+ */
12004
12118
  get ad(): any;
12005
12119
  /** {zh}
12006
12120
  * @brief 调用此方法开启直播日志上报。
@@ -12108,6 +12222,28 @@ declare namespace live {
12108
12222
  * @brief Obtain the playback information of FLV pull streaming.
12109
12223
  */
12110
12224
  getFLVStats(): FlvStats;
12225
+ updatePlaylist(playlist: ExposedSource[], target?: string | {
12226
+ /** {zh}
12227
+ * @brief 清晰度唯一标识。
12228
+ * @default 无
12229
+ *
12230
+ */
12231
+ /** {en}
12232
+ * @brief The resolution ID.
12233
+ *
12234
+ */
12235
+ definition?: string;
12236
+ /** {zh}
12237
+ * @brief 线路的唯一标识。
12238
+ * @default 无
12239
+ *
12240
+ */
12241
+ /** {en}
12242
+ * @brief The playback resource ID.
12243
+ *
12244
+ */
12245
+ source?: string;
12246
+ }, needUpdateProtocol?: boolean): Promise<void>;
12111
12247
  }
12112
12248
  /** {zh}
12113
12249
  * @detail api