@byteplus/veplayer 2.6.2-rc.0 → 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.
Files changed (40) hide show
  1. package/esm/index.d.ts +41 -119
  2. package/esm/veplayer.biz.live.development.css +1 -2
  3. package/esm/veplayer.biz.live.development.js +958 -344
  4. package/esm/veplayer.biz.live.production.css +1 -1
  5. package/esm/veplayer.biz.live.production.js +1 -1
  6. package/esm/veplayer.d.ts +366 -266
  7. package/esm/veplayer.development.css +1 -2
  8. package/esm/veplayer.development.js +919 -333
  9. package/esm/veplayer.live.d.ts +366 -266
  10. package/esm/veplayer.live.development.css +1 -2
  11. package/esm/veplayer.live.development.js +918 -332
  12. package/esm/veplayer.live.production.css +1 -1
  13. package/esm/veplayer.live.production.js +3 -3
  14. package/esm/veplayer.production.css +1 -1
  15. package/esm/veplayer.production.js +3 -3
  16. package/esm/veplayer.vod.d.ts +41 -119
  17. package/esm/veplayer.vod.development.js +37 -21
  18. package/esm/veplayer.vod.production.js +2 -2
  19. package/package.json +1 -1
  20. package/umd/index.d.ts +41 -119
  21. package/umd/veplayer.biz.live.development.css +1 -2
  22. package/umd/veplayer.biz.live.development.js +958 -344
  23. package/umd/veplayer.biz.live.production.css +1 -1
  24. package/umd/veplayer.biz.live.production.js +1 -1
  25. package/umd/veplayer.d.ts +366 -266
  26. package/umd/veplayer.development.css +1 -2
  27. package/umd/veplayer.development.js +919 -333
  28. package/umd/veplayer.live.d.ts +366 -266
  29. package/umd/veplayer.live.development.css +1 -2
  30. package/umd/veplayer.live.development.js +918 -332
  31. package/umd/veplayer.live.production.css +1 -1
  32. package/umd/veplayer.live.production.js +1 -1
  33. package/umd/veplayer.production.css +1 -1
  34. package/umd/veplayer.production.js +1 -1
  35. package/umd/veplayer.vod.d.ts +41 -119
  36. package/umd/veplayer.vod.development.js +37 -21
  37. package/umd/veplayer.vod.production.js +1 -1
  38. package/veplayer.d.ts +366 -266
  39. package/veplayer.live.d.ts +366 -266
  40. package/veplayer.vod.d.ts +41 -119
package/esm/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.
@@ -6305,12 +6324,14 @@ interface StatsSnapShoot {
6305
6324
  /** {zh}
6306
6325
  * @list option
6307
6326
  * @kind property
6327
+ * @brief FLV 直播流播放信息。
6308
6328
  */
6309
6329
  /** {en}
6310
6330
  * @list option
6311
6331
  * @kind property
6332
+ * @brief FLV live stream information.
6312
6333
  */
6313
- interface Stats$0 {
6334
+ interface FlvStats {
6314
6335
  /** {zh}
6315
6336
  * @brief 音频格式。
6316
6337
  * @hidden
@@ -6412,45 +6433,33 @@ interface Stats$0 {
6412
6433
  */
6413
6434
  samplerate: number;
6414
6435
  /** {zh}
6415
- * @hidden
6436
+ * @brief 总共收到的字节数。
6416
6437
  */
6417
6438
  /** {en}
6418
- * @hidden
6439
+ * @brief The total number of bytes received.
6419
6440
  */
6420
- videoCodec: string;
6441
+ totalReceivedByte: number;
6421
6442
  /** {zh}
6422
- * @brief 视频宽度。
6443
+ * @brief 接收所有字节消耗时长。
6423
6444
  */
6424
6445
  /** {en}
6425
- * @brief Video wight.
6446
+ * @brief The time consumed for receiving all bytes.
6426
6447
  */
6427
- width: number;
6428
- }
6429
- /** {zh}
6430
- * @list option
6431
- * @kind property
6432
- * @brief FLV 直播流播放信息。
6433
- */
6434
- /** {en}
6435
- * @list option
6436
- * @kind property
6437
- * @brief FLV live stream information.
6438
- */
6439
- interface FlvStats extends Stats$0 {
6448
+ totalReceivedCost: number;
6440
6449
  /** {zh}
6441
- * @brief 总共收到的字节数。
6450
+ * @hidden
6442
6451
  */
6443
6452
  /** {en}
6444
- * @brief The total number of bytes received.
6453
+ * @hidden
6445
6454
  */
6446
- totalReceivedByte: number;
6455
+ videoCodec: string;
6447
6456
  /** {zh}
6448
- * @brief 接收所有字节消耗时长。
6457
+ * @brief 视频宽度。
6449
6458
  */
6450
6459
  /** {en}
6451
- * @brief The time consumed for receiving all bytes.
6460
+ * @brief Video wight.
6452
6461
  */
6453
- totalReceivedCost: number;
6462
+ width: number;
6454
6463
  }
6455
6464
  /** {zh}
6456
6465
  * @detail api
@@ -6463,6 +6472,7 @@ interface FlvStats extends Stats$0 {
6463
6472
  * @inheritdoc
6464
6473
  */
6465
6474
  declare class VePlayerLive extends VePlayerBase {
6475
+ _protocolManager?: ProtocolManager;
6466
6476
  /** {zh}
6467
6477
  * @hidden
6468
6478
  * @param options
@@ -6479,6 +6489,12 @@ declare class VePlayerLive extends VePlayerBase {
6479
6489
  * @brief Obtain the duration that has been played, excluding pause and waiting time, with the unit of seconds.
6480
6490
  */
6481
6491
  get playTime(): number;
6492
+ /** {en}
6493
+ * @hidden
6494
+ */
6495
+ /** {zh}
6496
+ * @hidden
6497
+ */
6482
6498
  get ad(): any;
6483
6499
  /** {zh}
6484
6500
  * @brief 调用此方法开启直播日志上报。
@@ -6586,14 +6602,28 @@ declare class VePlayerLive extends VePlayerBase {
6586
6602
  * @brief Obtain the playback information of FLV pull streaming.
6587
6603
  */
6588
6604
  getFLVStats(): FlvStats;
6589
- /** {zh}
6590
- * @brief 获取 HLS 拉流的播放信息。
6591
- * @returns
6592
- */
6593
- /** {en}
6594
- * @brief Obtain the playback information of HLS pull streaming.
6595
- */
6596
- getHLSStats(): Stats$0;
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>;
6597
6627
  }
6598
6628
  /** {zh}
6599
6629
  * @detail api
@@ -6841,25 +6871,24 @@ declare namespace live {
6841
6871
  */
6842
6872
  enum Level {
6843
6873
  /** {zh}
6844
- * @brief 严重。
6874
+ * @brief 发生严重错误,可能由于 CDN 拉取失败或 DRM 权限验证未通过,导致无法播放。
6845
6875
  */
6846
6876
  /** {en}
6847
- * @brief Fatal.
6848
- *
6877
+ * @brief A critical error occurs, typically due to CDN fetching failure or DRM permission verification failure, resulting in playback inability.
6849
6878
  */
6850
6879
  Fatal = "Fatal",
6851
6880
  /** {zh}
6852
- * @brief 报错。
6881
+ * @brief 流异常或处于离线状态,致使播放失败。
6853
6882
  */
6854
6883
  /** {en}
6855
- * @brief Error.
6884
+ * @brief A stream anomaly or offline state causes playback to fail.
6856
6885
  */
6857
6886
  Error = "Error",
6858
6887
  /** {zh}
6859
- * @brief 提示。
6888
+ * @brief 出现警告信息,通常由日志配置错误或缺少 RTM 降级地址引起。
6860
6889
  */
6861
6890
  /** {en}
6862
- * @brief Warn.
6891
+ * @brief A warning is issued, usually due to incorrect log configuration or a missing RTM fallback address.
6863
6892
  */
6864
6893
  Warn = "Warn"
6865
6894
  }
@@ -7283,8 +7312,8 @@ declare namespace live {
7283
7312
  next: DefinitionUrl | null;
7284
7313
  }
7285
7314
  function arrayToList(urls?: string[]): DefinitionUrl;
7286
- class Definition implements XGDefinition {
7287
- readonly definition: string;
7315
+ class Definition {
7316
+ readonly definition?: string;
7288
7317
  readonly source: Source;
7289
7318
  readonly text?: Record<Lang, string> | string;
7290
7319
  readonly fallbackUrl: DefinitionUrl;
@@ -7292,7 +7321,7 @@ declare namespace live {
7292
7321
  private _currentUrlRef;
7293
7322
  constructor(definitionSetting: {
7294
7323
  url: string;
7295
- definition: string;
7324
+ definition?: string;
7296
7325
  source: Source;
7297
7326
  text?: Record<Lang, string> | string;
7298
7327
  fallbackUrls?: string[];
@@ -7318,7 +7347,6 @@ declare namespace live {
7318
7347
  interface ExposedDefinition {
7319
7348
  /** {zh}
7320
7349
  * @brief 播放地址。
7321
- * @default 无
7322
7350
  */
7323
7351
  /** {en}
7324
7352
  * @brief The playback address.
@@ -7326,17 +7354,14 @@ declare namespace live {
7326
7354
  url: string;
7327
7355
  /** {zh}
7328
7356
  * @brief 清晰度标识(唯一值)。
7329
- * @default 无
7330
- *
7331
7357
  */
7332
7358
  /** {en}
7333
7359
  * @brief The resolution ID. This value must be unique.
7334
7360
  *
7335
7361
  */
7336
- definition: string;
7362
+ definition?: string;
7337
7363
  /** {zh}
7338
7364
  * @brief 清晰度展示名称。可设置多语言 `{text: {'zh-cn': '高清', 'en': 'HD'}}`。
7339
- * @default 无
7340
7365
  */
7341
7366
  /** {en}
7342
7367
  * @brief The display name of the resolution. Multiple languages are supported, such as `{text: {'zh-cn': '高清', 'en': 'HD'}}`.
@@ -7344,14 +7369,13 @@ declare namespace live {
7344
7369
  text?: Record<Lang, string> | string;
7345
7370
  /** {zh}
7346
7371
  * @brief 为当前清晰度地址设置备路拉流地址,支持设置多个备路拉流地址。当前清晰度地址拉流失败时,会在当前清晰度地址和备路直播地址之间循环拉流,直到拉流成功。
7347
- * @default 无
7348
- *
7349
7372
  */
7350
7373
  /** {en}
7351
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.
7352
7375
  *
7353
7376
  */
7354
7377
  fallbackUrls?: string[];
7378
+ type?: string;
7355
7379
  }
7356
7380
  /** {zh}
7357
7381
  * @list option
@@ -7368,7 +7392,6 @@ declare namespace live {
7368
7392
  interface ExposedSource {
7369
7393
  /** {zh}
7370
7394
  * @brief 线路标识(唯一值)。
7371
- * @default 无
7372
7395
  */
7373
7396
  /** {en}
7374
7397
  * @brief The playback source ID. This value must be unique.
@@ -7376,8 +7399,6 @@ declare namespace live {
7376
7399
  name?: string;
7377
7400
  /** {zh}
7378
7401
  * @brief 线路展示名称。可设置多语言 `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`。
7379
- * @default 无
7380
- *
7381
7402
  */
7382
7403
  /** {en}
7383
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'}}`.
@@ -7386,8 +7407,6 @@ declare namespace live {
7386
7407
  text?: Record<Lang, string> | string;
7387
7408
  /** {zh}
7388
7409
  * @brief 该线路下清晰度列表。
7389
- * @default 无
7390
- *
7391
7410
  */
7392
7411
  /** {en}
7393
7412
  * @brief A list of resolutions of the current source.
@@ -7930,7 +7949,7 @@ declare namespace live {
7930
7949
  */
7931
7950
  autoHide: boolean;
7932
7951
  /** {zh}
7933
- * @brief 自动隐藏的延迟时间, 单位为 ms。
7952
+ * @brief 自动隐藏的延迟时间,单位为 ms。
7934
7953
  */
7935
7954
  /** {en}
7936
7955
  * @brief The latency of auto hiding, in milliseconds.
@@ -8669,7 +8688,6 @@ declare namespace live {
8669
8688
  showRefresh?: boolean;
8670
8689
  /** {zh}
8671
8690
  * @brief 自定义报错显示。
8672
- * @default 无
8673
8691
  */
8674
8692
  /** {en}
8675
8693
  * @brief Custom error message.
@@ -8678,7 +8696,6 @@ declare namespace live {
8678
8696
  errorTipsText?: string | Record<Lang, string>;
8679
8697
  /** {zh}
8680
8698
  * @brief 更多提示信息。
8681
- * @default 无
8682
8699
  */
8683
8700
  /** {en}
8684
8701
  * @brief More tips.
@@ -8838,7 +8855,6 @@ declare namespace live {
8838
8855
  id?: string;
8839
8856
  /** {zh}
8840
8857
  * @brief 指定播放器容器元素,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
8841
- * @default 无
8842
8858
  */
8843
8859
  /** {en}
8844
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`.
@@ -8864,7 +8880,6 @@ declare namespace live {
8864
8880
  height?: number | string;
8865
8881
  /** {zh}
8866
8882
  * @brief 为播放器配置直播拉流地址。您可手动拼接或使用地址生成器生成拉流地址,生成方法请参见[生成直播地址](https://www.volcengine.com/docs/6469/107759)。url 和 playList 需至少传入 1 个。
8867
- * @default 无
8868
8883
  */
8869
8884
  /** {en}
8870
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.
@@ -8872,7 +8887,6 @@ declare namespace live {
8872
8887
  url?: string;
8873
8888
  /** {zh}
8874
8889
  * @brief 为播放器配置直播拉流地址列表。url 和 playlist 需至少传入 1 个。
8875
- * @default 无
8876
8890
  */
8877
8891
  /** {en}
8878
8892
  * @brief A list of live stream sources for the player. You should specify either `url` or `playList`, or both.
@@ -8880,7 +8894,6 @@ declare namespace live {
8880
8894
  playlist?: ExposedSource[];
8881
8895
  /** {zh}
8882
8896
  * @brief 当存在多个直播线路时,为播放器设置默认直播线路,不传则默认列表第一个。
8883
- * @default 无
8884
8897
  */
8885
8898
  /** {en}
8886
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.
@@ -8888,7 +8901,6 @@ declare namespace live {
8888
8901
  defaultSource?: string;
8889
8902
  /** {zh}
8890
8903
  * @brief 为播放器设置默认直播清晰度,不传则默认列表第一个。
8891
- * @default 无
8892
8904
  */
8893
8905
  /** {en}
8894
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.
@@ -8896,7 +8908,6 @@ declare namespace live {
8896
8908
  defaultDefinition?: string;
8897
8909
  /** {zh}
8898
8910
  * @brief 为播放器设置备路拉流地址,支持设置多个备路拉流地址,在 `maxFallbackRound` 大于 `0` 时有效。当您使用配置的直播拉流地址拉流失败时,会在直播地址和备路直播地址之间循环拉流,直到拉流成功。
8899
- * @default 无
8900
8911
  */
8901
8912
  /** {en}
8902
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.
@@ -8950,7 +8961,6 @@ declare namespace live {
8950
8961
  degradation?: Degradation | boolean;
8951
8962
  /** {zh}
8952
8963
  * @brief 为播放器设置封面图 URL。
8953
- * @default 无
8954
8964
  */
8955
8965
  /** {en}
8956
8966
  * @brief The URL of the player's cover image.
@@ -8966,7 +8976,6 @@ declare namespace live {
8966
8976
  /** {zh}
8967
8977
  * @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }。
8968
8978
  * 例如,{ texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }} ,格式请参考[默认词典](https://www.volcengine.com/docs/6469/127529)。
8969
- * @default 无
8970
8979
  */
8971
8980
  /** {en}
8972
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' } }}.
@@ -8976,7 +8985,7 @@ declare namespace live {
8976
8985
  texts: Record<Lang, Record<string, string>>;
8977
8986
  };
8978
8987
  /** {zh}
8979
- * @brief 为播放器设置是否自动播放, `muted` 设置为 `true` 为静音自动播放。
8988
+ * @brief 为播放器设置是否自动播放,`muted` 设置为 `true` 为静音自动播放。
8980
8989
  * @default { muted: true }
8981
8990
  * @type {{ muted: boolean } | boolean}
8982
8991
  */
@@ -9082,7 +9091,6 @@ declare namespace live {
9082
9091
  playsinline?: boolean;
9083
9092
  /** {zh}
9084
9093
  * @brief 为播放器设置 video 标签扩展属性,初始化时会设置在 videoElement 或 audioElement 对象上,请参考 [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) 查看其支持的属性配置。
9085
- * @default 无
9086
9094
  */
9087
9095
  /** {en}
9088
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.
@@ -9160,7 +9168,6 @@ declare namespace live {
9160
9168
  marginControls?: boolean;
9161
9169
  /** {zh}
9162
9170
  * @brief 启用微信同层播放。
9163
- * @default 无
9164
9171
  */
9165
9172
  /** {en}
9166
9173
  * @brief Enable playing the video on the same player as WeChat.
@@ -9170,7 +9177,6 @@ declare namespace live {
9170
9177
  * @brief 是否启用微信全屏播放模式。
9171
9178
  * - `true`:启用
9172
9179
  * - `false`:停用
9173
- * @default 无
9174
9180
  */
9175
9181
  /** {en}
9176
9182
  * @brief Whether to enable full-screen playback in WeChat.
@@ -9183,7 +9189,6 @@ declare namespace live {
9183
9189
  * - `landscape`:横屏
9184
9190
  * - `portrait`:竖屏
9185
9191
  * - `landscape|portrait`:跟随手机自动旋转
9186
- * @default 无
9187
9192
  */
9188
9193
  /** {en}
9189
9194
  * @brief The orientation of the video when played on WeChat. The following values are supported:
@@ -9194,7 +9199,6 @@ declare namespace live {
9194
9199
  "x5-video-orientation"?: "landscape" | "portrait" | "landscape|portrait";
9195
9200
  /** {zh}
9196
9201
  * @brief 为播放器配置关键点样式。
9197
- * @default 无
9198
9202
  * @hidden 直播目前没用到
9199
9203
  */
9200
9204
  /** {en}
@@ -9204,7 +9208,6 @@ declare namespace live {
9204
9208
  commonStyle?: CommonStyle;
9205
9209
  /** {zh}
9206
9210
  * @brief 自定义插件列表。
9207
- * @default 无
9208
9211
  */
9209
9212
  /** {en}
9210
9213
  * @brief A list of custom plugins.
@@ -9247,10 +9250,10 @@ declare namespace live {
9247
9250
  */
9248
9251
  closeVideoDblclick?: boolean;
9249
9252
  /** {zh}
9250
- * @brief 支持传入 video dom,常应用于多播放器复用同一 video 场景。
9253
+ * @brief 支持传入 `video` DOM 元素,适用于多个播放器共享同一视频场景。
9251
9254
  */
9252
9255
  /** {en}
9253
- * @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.
9254
9257
  */
9255
9258
  mediaElement?: HTMLVideoElement | null;
9256
9259
  }
@@ -9319,7 +9322,6 @@ declare namespace live {
9319
9322
  interface CommonStyle {
9320
9323
  /** {zh}
9321
9324
  * @brief 进度条底色。
9322
- * @default 无
9323
9325
  */
9324
9326
  /** {en}
9325
9327
  * @brief The background color of the progress bar.
@@ -9327,7 +9329,6 @@ declare namespace live {
9327
9329
  progressColor?: string;
9328
9330
  /** {zh}
9329
9331
  * @brief 播放完成部分进度条底色。
9330
- * @default 无
9331
9332
  */
9332
9333
  /** {en}
9333
9334
  * @brief The background color of the progress bar for the completed portion of video playback.
@@ -9335,7 +9336,6 @@ declare namespace live {
9335
9336
  playedColor?: string;
9336
9337
  /** {zh}
9337
9338
  * @brief 缓存部分进度条底色。
9338
- * @default 无
9339
9339
  */
9340
9340
  /** {en}
9341
9341
  * @brief
@@ -9344,7 +9344,6 @@ declare namespace live {
9344
9344
  cachedColor?: string;
9345
9345
  /** {zh}
9346
9346
  * @brief 进度条滑块样式。
9347
- * @default 无
9348
9347
  */
9349
9348
  /** {en}
9350
9349
  * @brief The style of the progress bar slider.
@@ -9355,7 +9354,6 @@ declare namespace live {
9355
9354
  };
9356
9355
  /** {zh}
9357
9356
  * @brief 音量颜色。
9358
- * @default 无
9359
9357
  */
9360
9358
  /** {en}
9361
9359
  * @brief The color of the volume slider.
@@ -9366,9 +9364,10 @@ declare namespace live {
9366
9364
  options?: Partial<VePlayerBaseOptions>;
9367
9365
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9368
9366
  plugins?: any[];
9367
+ protocol?: string;
9369
9368
  useSrc?: boolean;
9370
9369
  };
9371
- type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
9370
+ type PreparePlugins = (url?: string) => Promise<PrepareResult | undefined> | undefined;
9372
9371
  /** {zh}
9373
9372
  * @detail option
9374
9373
  * @brief 视频的实际编码格式。如果您在 degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
@@ -9493,6 +9492,7 @@ declare namespace live {
9493
9492
  private _events;
9494
9493
  private _customMedia?;
9495
9494
  private _errorCallback;
9495
+ private _beforeFallbackError;
9496
9496
  /** {zh}
9497
9497
  * @hidden
9498
9498
  */
@@ -9532,7 +9532,7 @@ declare namespace live {
9532
9532
  */
9533
9533
  get played(): TimeRanges;
9534
9534
  /** {zh}
9535
- * @brief 设置/获取视频当前的播放时间, 单位为 s。
9535
+ * @brief 设置/获取视频当前的播放时间,单位为 s。
9536
9536
  */
9537
9537
  /** {en}
9538
9538
  * @brief Sets or gets the current playback position of the video, in seconds.
@@ -9643,7 +9643,7 @@ declare namespace live {
9643
9643
  /** {en}
9644
9644
  * @brief Gets the current resolution ID.
9645
9645
  */
9646
- get definition(): string;
9646
+ get definition(): string | undefined;
9647
9647
  /** {zh}
9648
9648
  * @brief 获取和设置播放器的跨域配置信息,更多信息参考 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性介绍。
9649
9649
  */
@@ -9733,7 +9733,6 @@ declare namespace live {
9733
9733
  switch(target: string | {
9734
9734
  /** {zh}
9735
9735
  * @brief 清晰度的唯一标识。
9736
- * @default 无
9737
9736
  */
9738
9737
  /** {en}
9739
9738
  * @brief The resolution ID.
@@ -9741,7 +9740,6 @@ declare namespace live {
9741
9740
  definition?: string;
9742
9741
  /** {zh}
9743
9742
  * @brief 线路的唯一标识。
9744
- * @default 无
9745
9743
  */
9746
9744
  /** {en}
9747
9745
  * @brief The playback source ID.
@@ -9781,8 +9779,6 @@ declare namespace live {
9781
9779
  updatePlaylist(playlist: ExposedSource[] | string, target?: string | {
9782
9780
  /** {zh}
9783
9781
  * @brief 清晰度唯一标识。
9784
- * @default 无
9785
- *
9786
9782
  */
9787
9783
  /** {en}
9788
9784
  * @brief The resolution ID.
@@ -9791,8 +9787,6 @@ declare namespace live {
9791
9787
  definition?: string;
9792
9788
  /** {zh}
9793
9789
  * @brief 线路的唯一标识。
9794
- * @default 无
9795
- *
9796
9790
  */
9797
9791
  /** {en}
9798
9792
  * @brief The playback resource ID.
@@ -9993,7 +9987,6 @@ declare namespace live {
9993
9987
  Function | {
9994
9988
  /** {zh}
9995
9989
  * @brief 插件构造函数。
9996
- * @default 无
9997
9990
  */
9998
9991
  /** {en}
9999
9992
  * @brief The plugin constructor.
@@ -10002,7 +9995,6 @@ declare namespace live {
10002
9995
  plugin: Function;
10003
9996
  /** {zh}
10004
9997
  * @brief 插件配置参数。
10005
- * @default 无
10006
9998
  */
10007
9999
  /** {en}
10008
10000
  * @brief The plugin configurations.
@@ -10357,7 +10349,6 @@ declare namespace live {
10357
10349
  };
10358
10350
  updateLang(): void;
10359
10351
  beforeCreate(args: XGPluginOptions): void;
10360
- afterCreate(): void;
10361
10352
  registerIcons(): {
10362
10353
  source: {
10363
10354
  icon: any;
@@ -10635,7 +10626,7 @@ declare namespace live {
10635
10626
  EMPTY_RTM_FALLBACK_PARAMETER = 211,
10636
10627
  /** {zh}
10637
10628
  * @brief 日志错误
10638
- * @solution 未正确配置质量日志参数, 请参考 https://www.volcengine.com/docs/6469/138655#日志上报 配置。
10629
+ * @solution 未正确配置质量日志参数,请参考 https://www.volcengine.com/docs/6469/138655#日志上报 配置。
10639
10630
  */
10640
10631
  /** {en}
10641
10632
  * @brief Log errors.
@@ -10801,7 +10792,6 @@ declare namespace live {
10801
10792
  enable?: boolean;
10802
10793
  /** {zh}
10803
10794
  * @brief 应用 ID,登录[视频直播控制台 > SDK 管理](https://console.volcengine.com/live/main/sdk)查询。
10804
- * @default 无
10805
10795
  */
10806
10796
  /** {en}
10807
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).
@@ -10809,7 +10799,6 @@ declare namespace live {
10809
10799
  appId?: string;
10810
10800
  /** {zh}
10811
10801
  * @brief 应用名称。
10812
- * @default 无
10813
10802
  */
10814
10803
  /** {en}
10815
10804
  * @brief The application name.
@@ -10819,7 +10808,6 @@ declare namespace live {
10819
10808
  * @brief 用于识别单一用户的 ID,如不设置,会随机生成一个用户 ID 存在浏览器缓存中。
10820
10809
  * @listtip
10821
10810
  * 建议您使用与业务相关的用户 ID,以便在发生播放错误时快速定位排查问题。
10822
- * @default 无
10823
10811
  */
10824
10812
  /** {en}
10825
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.
@@ -10831,7 +10819,6 @@ declare namespace live {
10831
10819
  * @brief 用于识别用户设备的 ID,如不设置,会随机生成一个用户 ID 存在浏览器缓存中。
10832
10820
  * @listtip
10833
10821
  * 建议您使用与业务相关的用户设备 ID,以便在发生播放错误时快速定位排查问题。
10834
- * @default 无
10835
10822
  */
10836
10823
  /** {en}
10837
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.
@@ -10870,6 +10857,88 @@ declare namespace live {
10870
10857
  private _createTea;
10871
10858
  private _start;
10872
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
+ }
10873
10942
  /** {zh}
10874
10943
  * @list option
10875
10944
  * @kind property
@@ -10924,6 +10993,7 @@ declare namespace live {
10924
10993
  */
10925
10994
  /** {en}
10926
10995
  * @brief Configurations for advertising
10996
+ * @hidden
10927
10997
  */
10928
10998
  ad?: AdConfig;
10929
10999
  /** {zh}
@@ -10942,15 +11012,13 @@ declare namespace live {
10942
11012
  logger?: LoggerConfig;
10943
11013
  /** {zh}
10944
11014
  * @brief 为播放器禁用内置插件列表,接入方法请参见[插件说明](https://www.volcengine.com/docs/6469/192826#禁用插件)。
10945
- * @default 无
10946
11015
  */
10947
11016
  /** {en}
10948
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).
10949
11018
  */
10950
11019
  ignores?: string[];
10951
11020
  /** {zh}
10952
- * @brief 为播放器替换插件图标,接入方法请参见[插件说明](https://www.volcengine.com/docs/6469/192826#替换插件图标)。
10953
- * @default 无
11021
+ * @brief 为播放器替换插件图标,接入方法请参见[插件说明](https://www.volcengine.com/docs/6469/192826)。
10954
11022
  */
10955
11023
  /** {en}
10956
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).
@@ -10963,6 +11031,16 @@ declare namespace live {
10963
11031
  * @brief Digital Rights Management (DRM) configurations.
10964
11032
  */
10965
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
+ }>;
10966
11044
  }
10967
11045
  /** {zh}
10968
11046
  * @list option
@@ -11194,6 +11272,7 @@ declare namespace live {
11194
11272
  * @list option
11195
11273
  * @kind property
11196
11274
  * @brief Advertising schedule for a single ad break
11275
+ * @hidden
11197
11276
  */
11198
11277
  interface AdRule {
11199
11278
  /** {en}
@@ -11215,6 +11294,7 @@ declare namespace live {
11215
11294
  * @list option
11216
11295
  * @kind property
11217
11296
  * @brief Configurations for Google IMA SDK
11297
+ * @hidden
11218
11298
  */
11219
11299
  interface ImaConfig {
11220
11300
  /** {en}
@@ -11237,6 +11317,7 @@ declare namespace live {
11237
11317
  * @list option
11238
11318
  * @kind property
11239
11319
  * @brief Configurations for advertising
11320
+ * @hidden
11240
11321
  */
11241
11322
  interface AdConfig {
11242
11323
  /** {en}
@@ -11287,7 +11368,8 @@ declare namespace live {
11287
11368
  * @brief 配置 RTM 拉流失败降级地址,可配置 FLV 拉流地址或 HLS 的拉流地址。`enableFallback` 为 `true` 时生效。
11288
11369
  * - 指定 `fallbackUrl`:当前环境不支持播放 RTM 或 RTM 拉流建联失败时,降级到 `fallbackUrl` 拉流地址。
11289
11370
  * - 未指定 `fallbackUrl`:当前环境不支持播放 RTM 或 RTM 拉流建联失败时,根据当前 RTM 地址降级到对应的 FLV 或者 HLS 地址。
11290
- * @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)。
11291
11373
  */
11292
11374
  /** {en}
11293
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`.
@@ -11380,6 +11462,13 @@ declare namespace live {
11380
11462
  * @hidden
11381
11463
  */
11382
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;
11383
11472
  }
11384
11473
  /** {zh}
11385
11474
  * @list option
@@ -11422,7 +11511,7 @@ declare namespace live {
11422
11511
  * - `true`:开启;
11423
11512
  * - `false`:关闭
11424
11513
  * @default false
11425
- * @listtip 低延迟 FLV 拉流仅在 PC 端浏览器中生效。
11514
+ * @listtip v2.5.2 版本后支持 FLV H5 端低延迟拉流。
11426
11515
  */
11427
11516
  /** {en}
11428
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.
@@ -11593,7 +11682,7 @@ declare namespace live {
11593
11682
  */
11594
11683
  interface RTMNetWorkInfo {
11595
11684
  /** {zh}
11596
- * @brief 最近一次网络评估周期内的下载速度, 单位为 bps。
11685
+ * @brief 最近一次网络评估周期内的下载速度,单位为 bps。
11597
11686
  */
11598
11687
  /** {en}
11599
11688
  * @brief The download speed within the latest network evaluation period, in units of bps.
@@ -11855,12 +11944,14 @@ declare namespace live {
11855
11944
  /** {zh}
11856
11945
  * @list option
11857
11946
  * @kind property
11947
+ * @brief FLV 直播流播放信息。
11858
11948
  */
11859
11949
  /** {en}
11860
11950
  * @list option
11861
11951
  * @kind property
11952
+ * @brief FLV live stream information.
11862
11953
  */
11863
- interface Stats$0 {
11954
+ interface FlvStats {
11864
11955
  /** {zh}
11865
11956
  * @brief 音频格式。
11866
11957
  * @hidden
@@ -11962,45 +12053,33 @@ declare namespace live {
11962
12053
  */
11963
12054
  samplerate: number;
11964
12055
  /** {zh}
11965
- * @hidden
12056
+ * @brief 总共收到的字节数。
11966
12057
  */
11967
12058
  /** {en}
11968
- * @hidden
12059
+ * @brief The total number of bytes received.
11969
12060
  */
11970
- videoCodec: string;
12061
+ totalReceivedByte: number;
11971
12062
  /** {zh}
11972
- * @brief 视频宽度。
12063
+ * @brief 接收所有字节消耗时长。
11973
12064
  */
11974
12065
  /** {en}
11975
- * @brief Video wight.
12066
+ * @brief The time consumed for receiving all bytes.
11976
12067
  */
11977
- width: number;
11978
- }
11979
- /** {zh}
11980
- * @list option
11981
- * @kind property
11982
- * @brief FLV 直播流播放信息。
11983
- */
11984
- /** {en}
11985
- * @list option
11986
- * @kind property
11987
- * @brief FLV live stream information.
11988
- */
11989
- interface FlvStats extends Stats$0 {
12068
+ totalReceivedCost: number;
11990
12069
  /** {zh}
11991
- * @brief 总共收到的字节数。
12070
+ * @hidden
11992
12071
  */
11993
12072
  /** {en}
11994
- * @brief The total number of bytes received.
12073
+ * @hidden
11995
12074
  */
11996
- totalReceivedByte: number;
12075
+ videoCodec: string;
11997
12076
  /** {zh}
11998
- * @brief 接收所有字节消耗时长。
12077
+ * @brief 视频宽度。
11999
12078
  */
12000
12079
  /** {en}
12001
- * @brief The time consumed for receiving all bytes.
12080
+ * @brief Video wight.
12002
12081
  */
12003
- totalReceivedCost: number;
12082
+ width: number;
12004
12083
  }
12005
12084
  /** {zh}
12006
12085
  * @detail api
@@ -12013,6 +12092,7 @@ declare namespace live {
12013
12092
  * @inheritdoc
12014
12093
  */
12015
12094
  class VePlayerLive extends VePlayerBase {
12095
+ _protocolManager?: ProtocolManager;
12016
12096
  /** {zh}
12017
12097
  * @hidden
12018
12098
  * @param options
@@ -12029,6 +12109,12 @@ declare namespace live {
12029
12109
  * @brief Obtain the duration that has been played, excluding pause and waiting time, with the unit of seconds.
12030
12110
  */
12031
12111
  get playTime(): number;
12112
+ /** {en}
12113
+ * @hidden
12114
+ */
12115
+ /** {zh}
12116
+ * @hidden
12117
+ */
12032
12118
  get ad(): any;
12033
12119
  /** {zh}
12034
12120
  * @brief 调用此方法开启直播日志上报。
@@ -12136,14 +12222,28 @@ declare namespace live {
12136
12222
  * @brief Obtain the playback information of FLV pull streaming.
12137
12223
  */
12138
12224
  getFLVStats(): FlvStats;
12139
- /** {zh}
12140
- * @brief 获取 HLS 拉流的播放信息。
12141
- * @returns
12142
- */
12143
- /** {en}
12144
- * @brief Obtain the playback information of HLS pull streaming.
12145
- */
12146
- getHLSStats(): Stats$0;
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>;
12147
12247
  }
12148
12248
  /** {zh}
12149
12249
  * @detail api