@volcengine/veplayer 2.6.2 → 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 +16 -19
  2. package/esm/veplayer.biz.live.development.css +1 -2
  3. package/esm/veplayer.biz.live.development.js +953 -345
  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 +285 -93
  7. package/esm/veplayer.development.css +1 -2
  8. package/esm/veplayer.development.js +912 -332
  9. package/esm/veplayer.live.d.ts +285 -93
  10. package/esm/veplayer.live.development.css +1 -2
  11. package/esm/veplayer.live.development.js +911 -331
  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 +16 -19
  17. package/esm/veplayer.vod.development.js +36 -20
  18. package/esm/veplayer.vod.production.js +2 -2
  19. package/package.json +1 -1
  20. package/umd/index.d.ts +16 -19
  21. package/umd/veplayer.biz.live.development.css +1 -2
  22. package/umd/veplayer.biz.live.development.js +953 -345
  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 +285 -93
  26. package/umd/veplayer.development.css +1 -2
  27. package/umd/veplayer.development.js +912 -332
  28. package/umd/veplayer.live.d.ts +285 -93
  29. package/umd/veplayer.live.development.css +1 -2
  30. package/umd/veplayer.live.development.js +911 -331
  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 +16 -19
  36. package/umd/veplayer.vod.development.js +36 -20
  37. package/umd/veplayer.vod.production.js +1 -1
  38. package/veplayer.d.ts +285 -93
  39. package/veplayer.live.d.ts +285 -93
  40. package/veplayer.vod.d.ts +16 -19
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[];
@@ -211,7 +210,7 @@ interface ExposedDefinition {
211
210
  * @brief The resolution ID. This value must be unique.
212
211
  *
213
212
  */
214
- definition: string;
213
+ definition?: string;
215
214
  /** {zh}
216
215
  * @brief 清晰度展示名称。可设置多语言 `{text: {'zh-cn': '高清', 'en': 'HD'}}`。
217
216
  */
@@ -227,6 +226,7 @@ interface ExposedDefinition {
227
226
  *
228
227
  */
229
228
  fallbackUrls?: string[];
229
+ type?: string;
230
230
  }
231
231
  /** {zh}
232
232
  * @list option
@@ -1613,9 +1613,10 @@ type PrepareResult = {
1613
1613
  options?: Partial<VePlayerBaseOptions>;
1614
1614
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1615
1615
  plugins?: any[];
1616
+ protocol?: string;
1616
1617
  useSrc?: boolean;
1617
1618
  };
1618
- type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
1619
+ type PreparePlugins = (url?: string) => Promise<PrepareResult | undefined> | undefined;
1619
1620
  /** {zh}
1620
1621
  * @detail option
1621
1622
  * @brief 视频的实际编码格式。如果您在 degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
@@ -1739,6 +1740,7 @@ declare class VePlayerBase {
1739
1740
  private _events;
1740
1741
  private _customMedia?;
1741
1742
  private _errorCallback;
1743
+ private _beforeFallbackError;
1742
1744
  /** {zh}
1743
1745
  * @hidden
1744
1746
  */
@@ -1889,7 +1891,7 @@ declare class VePlayerBase {
1889
1891
  /** {en}
1890
1892
  * @brief Gets the current resolution ID.
1891
1893
  */
1892
- get definition(): string;
1894
+ get definition(): string | undefined;
1893
1895
  /** {zh}
1894
1896
  * @brief 获取和设置播放器的跨域配置信息,更多信息参考 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性介绍。
1895
1897
  */
@@ -2506,8 +2508,8 @@ declare namespace strategy {
2506
2508
  next: DefinitionUrl | null;
2507
2509
  }
2508
2510
  function arrayToList(urls?: string[]): DefinitionUrl;
2509
- class Definition implements XGDefinition {
2510
- readonly definition: string;
2511
+ class Definition {
2512
+ readonly definition?: string;
2511
2513
  readonly source: Source;
2512
2514
  readonly text?: Record<Lang, string> | string;
2513
2515
  readonly fallbackUrl: DefinitionUrl;
@@ -2515,7 +2517,7 @@ declare namespace strategy {
2515
2517
  private _currentUrlRef;
2516
2518
  constructor(definitionSetting: {
2517
2519
  url: string;
2518
- definition: string;
2520
+ definition?: string;
2519
2521
  source: Source;
2520
2522
  text?: Record<Lang, string> | string;
2521
2523
  fallbackUrls?: string[];
@@ -2553,7 +2555,7 @@ declare namespace strategy {
2553
2555
  * @brief The resolution ID. This value must be unique.
2554
2556
  *
2555
2557
  */
2556
- definition: string;
2558
+ definition?: string;
2557
2559
  /** {zh}
2558
2560
  * @brief 清晰度展示名称。可设置多语言 `{text: {'zh-cn': '高清', 'en': 'HD'}}`。
2559
2561
  */
@@ -2569,6 +2571,7 @@ declare namespace strategy {
2569
2571
  *
2570
2572
  */
2571
2573
  fallbackUrls?: string[];
2574
+ type?: string;
2572
2575
  }
2573
2576
  /** {zh}
2574
2577
  * @list option
@@ -3956,9 +3959,10 @@ declare namespace strategy {
3956
3959
  options?: Partial<VePlayerBaseOptions>;
3957
3960
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3958
3961
  plugins?: any[];
3962
+ protocol?: string;
3959
3963
  useSrc?: boolean;
3960
3964
  };
3961
- type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
3965
+ type PreparePlugins = (url?: string) => Promise<PrepareResult | undefined> | undefined;
3962
3966
  /** {zh}
3963
3967
  * @detail option
3964
3968
  * @brief 视频的实际编码格式。如果您在 degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
@@ -4138,13 +4142,6 @@ declare namespace strategy {
4138
4142
  function detectCodec(url: string): Promise<"unknown" | Codec>;
4139
4143
  function isSoftDecode(options: VePlayerBaseOptions, currentCodec?: Codec | "unknown"): Promise<boolean>;
4140
4144
  function combineOptions<T = VePlayerBaseOptions>(strategyList: (Strategy<T> | undefined)[]): Partial<T>;
4141
- const getHlsStrategy: (options: VePlayerBaseOptions) => Promise<{
4142
- options?: undefined;
4143
- plugins?: undefined;
4144
- } | {
4145
- options: Partial<VePlayerBaseOptions>;
4146
- plugins: any[];
4147
- }>;
4148
4145
  }
4149
4146
  declare function getStreamType(url: string): "unknown" | "hls" | "flv" | "rtm" | "mp4" | "dash";
4150
4147
  /** {zh}
@@ -5068,7 +5065,6 @@ declare class Sources extends OptionsIcon {
5068
5065
  };
5069
5066
  updateLang(): void;
5070
5067
  beforeCreate(args: XGPluginOptions): void;
5071
- afterCreate(): void;
5072
5068
  registerIcons(): {
5073
5069
  source: {
5074
5070
  icon: any;
@@ -5241,6 +5237,88 @@ interface LoggerConfig {
5241
5237
  */
5242
5238
  showUserIdInErrorPanel?: boolean;
5243
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
+ }
5244
5322
  /** {zh}
5245
5323
  * @list option
5246
5324
  * @kind property
@@ -5333,6 +5411,16 @@ interface LiveVePlayerOptions extends VePlayerBaseOptions {
5333
5411
  * @brief Digital Rights Management (DRM) configurations.
5334
5412
  */
5335
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
+ }>;
5336
5424
  }
5337
5425
  /** {zh}
5338
5426
  * @list option
@@ -6236,12 +6324,14 @@ interface StatsSnapShoot {
6236
6324
  /** {zh}
6237
6325
  * @list option
6238
6326
  * @kind property
6327
+ * @brief FLV 直播流播放信息。
6239
6328
  */
6240
6329
  /** {en}
6241
6330
  * @list option
6242
6331
  * @kind property
6332
+ * @brief FLV live stream information.
6243
6333
  */
6244
- interface Stats$0 {
6334
+ interface FlvStats {
6245
6335
  /** {zh}
6246
6336
  * @brief 音频格式。
6247
6337
  * @hidden
@@ -6343,45 +6433,33 @@ interface Stats$0 {
6343
6433
  */
6344
6434
  samplerate: number;
6345
6435
  /** {zh}
6346
- * @hidden
6436
+ * @brief 总共收到的字节数。
6347
6437
  */
6348
6438
  /** {en}
6349
- * @hidden
6439
+ * @brief The total number of bytes received.
6350
6440
  */
6351
- videoCodec: string;
6441
+ totalReceivedByte: number;
6352
6442
  /** {zh}
6353
- * @brief 视频宽度。
6443
+ * @brief 接收所有字节消耗时长。
6354
6444
  */
6355
6445
  /** {en}
6356
- * @brief Video wight.
6446
+ * @brief The time consumed for receiving all bytes.
6357
6447
  */
6358
- width: number;
6359
- }
6360
- /** {zh}
6361
- * @list option
6362
- * @kind property
6363
- * @brief FLV 直播流播放信息。
6364
- */
6365
- /** {en}
6366
- * @list option
6367
- * @kind property
6368
- * @brief FLV live stream information.
6369
- */
6370
- interface FlvStats extends Stats$0 {
6448
+ totalReceivedCost: number;
6371
6449
  /** {zh}
6372
- * @brief 总共收到的字节数。
6450
+ * @hidden
6373
6451
  */
6374
6452
  /** {en}
6375
- * @brief The total number of bytes received.
6453
+ * @hidden
6376
6454
  */
6377
- totalReceivedByte: number;
6455
+ videoCodec: string;
6378
6456
  /** {zh}
6379
- * @brief 接收所有字节消耗时长。
6457
+ * @brief 视频宽度。
6380
6458
  */
6381
6459
  /** {en}
6382
- * @brief The time consumed for receiving all bytes.
6460
+ * @brief Video wight.
6383
6461
  */
6384
- totalReceivedCost: number;
6462
+ width: number;
6385
6463
  }
6386
6464
  /** {zh}
6387
6465
  * @detail api
@@ -6394,6 +6472,7 @@ interface FlvStats extends Stats$0 {
6394
6472
  * @inheritdoc
6395
6473
  */
6396
6474
  declare class VePlayerLive extends VePlayerBase {
6475
+ _protocolManager?: ProtocolManager;
6397
6476
  /** {zh}
6398
6477
  * @hidden
6399
6478
  * @param options
@@ -6523,14 +6602,28 @@ declare class VePlayerLive extends VePlayerBase {
6523
6602
  * @brief Obtain the playback information of FLV pull streaming.
6524
6603
  */
6525
6604
  getFLVStats(): FlvStats;
6526
- /** {zh}
6527
- * @brief 获取 HLS 拉流的播放信息。
6528
- * @returns
6529
- */
6530
- /** {en}
6531
- * @brief Obtain the playback information of HLS pull streaming.
6532
- */
6533
- 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>;
6534
6627
  }
6535
6628
  /** {zh}
6536
6629
  * @detail api
@@ -7219,8 +7312,8 @@ declare namespace live {
7219
7312
  next: DefinitionUrl | null;
7220
7313
  }
7221
7314
  function arrayToList(urls?: string[]): DefinitionUrl;
7222
- class Definition implements XGDefinition {
7223
- readonly definition: string;
7315
+ class Definition {
7316
+ readonly definition?: string;
7224
7317
  readonly source: Source;
7225
7318
  readonly text?: Record<Lang, string> | string;
7226
7319
  readonly fallbackUrl: DefinitionUrl;
@@ -7228,7 +7321,7 @@ declare namespace live {
7228
7321
  private _currentUrlRef;
7229
7322
  constructor(definitionSetting: {
7230
7323
  url: string;
7231
- definition: string;
7324
+ definition?: string;
7232
7325
  source: Source;
7233
7326
  text?: Record<Lang, string> | string;
7234
7327
  fallbackUrls?: string[];
@@ -7266,7 +7359,7 @@ declare namespace live {
7266
7359
  * @brief The resolution ID. This value must be unique.
7267
7360
  *
7268
7361
  */
7269
- definition: string;
7362
+ definition?: string;
7270
7363
  /** {zh}
7271
7364
  * @brief 清晰度展示名称。可设置多语言 `{text: {'zh-cn': '高清', 'en': 'HD'}}`。
7272
7365
  */
@@ -7282,6 +7375,7 @@ declare namespace live {
7282
7375
  *
7283
7376
  */
7284
7377
  fallbackUrls?: string[];
7378
+ type?: string;
7285
7379
  }
7286
7380
  /** {zh}
7287
7381
  * @list option
@@ -9270,9 +9364,10 @@ declare namespace live {
9270
9364
  options?: Partial<VePlayerBaseOptions>;
9271
9365
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9272
9366
  plugins?: any[];
9367
+ protocol?: string;
9273
9368
  useSrc?: boolean;
9274
9369
  };
9275
- type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
9370
+ type PreparePlugins = (url?: string) => Promise<PrepareResult | undefined> | undefined;
9276
9371
  /** {zh}
9277
9372
  * @detail option
9278
9373
  * @brief 视频的实际编码格式。如果您在 degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
@@ -9397,6 +9492,7 @@ declare namespace live {
9397
9492
  private _events;
9398
9493
  private _customMedia?;
9399
9494
  private _errorCallback;
9495
+ private _beforeFallbackError;
9400
9496
  /** {zh}
9401
9497
  * @hidden
9402
9498
  */
@@ -9547,7 +9643,7 @@ declare namespace live {
9547
9643
  /** {en}
9548
9644
  * @brief Gets the current resolution ID.
9549
9645
  */
9550
- get definition(): string;
9646
+ get definition(): string | undefined;
9551
9647
  /** {zh}
9552
9648
  * @brief 获取和设置播放器的跨域配置信息,更多信息参考 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性介绍。
9553
9649
  */
@@ -10253,7 +10349,6 @@ declare namespace live {
10253
10349
  };
10254
10350
  updateLang(): void;
10255
10351
  beforeCreate(args: XGPluginOptions): void;
10256
- afterCreate(): void;
10257
10352
  registerIcons(): {
10258
10353
  source: {
10259
10354
  icon: any;
@@ -10762,6 +10857,88 @@ declare namespace live {
10762
10857
  private _createTea;
10763
10858
  private _start;
10764
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
+ }
10765
10942
  /** {zh}
10766
10943
  * @list option
10767
10944
  * @kind property
@@ -10854,6 +11031,16 @@ declare namespace live {
10854
11031
  * @brief Digital Rights Management (DRM) configurations.
10855
11032
  */
10856
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
+ }>;
10857
11044
  }
10858
11045
  /** {zh}
10859
11046
  * @list option
@@ -11757,12 +11944,14 @@ declare namespace live {
11757
11944
  /** {zh}
11758
11945
  * @list option
11759
11946
  * @kind property
11947
+ * @brief FLV 直播流播放信息。
11760
11948
  */
11761
11949
  /** {en}
11762
11950
  * @list option
11763
11951
  * @kind property
11952
+ * @brief FLV live stream information.
11764
11953
  */
11765
- interface Stats$0 {
11954
+ interface FlvStats {
11766
11955
  /** {zh}
11767
11956
  * @brief 音频格式。
11768
11957
  * @hidden
@@ -11864,45 +12053,33 @@ declare namespace live {
11864
12053
  */
11865
12054
  samplerate: number;
11866
12055
  /** {zh}
11867
- * @hidden
12056
+ * @brief 总共收到的字节数。
11868
12057
  */
11869
12058
  /** {en}
11870
- * @hidden
12059
+ * @brief The total number of bytes received.
11871
12060
  */
11872
- videoCodec: string;
12061
+ totalReceivedByte: number;
11873
12062
  /** {zh}
11874
- * @brief 视频宽度。
12063
+ * @brief 接收所有字节消耗时长。
11875
12064
  */
11876
12065
  /** {en}
11877
- * @brief Video wight.
12066
+ * @brief The time consumed for receiving all bytes.
11878
12067
  */
11879
- width: number;
11880
- }
11881
- /** {zh}
11882
- * @list option
11883
- * @kind property
11884
- * @brief FLV 直播流播放信息。
11885
- */
11886
- /** {en}
11887
- * @list option
11888
- * @kind property
11889
- * @brief FLV live stream information.
11890
- */
11891
- interface FlvStats extends Stats$0 {
12068
+ totalReceivedCost: number;
11892
12069
  /** {zh}
11893
- * @brief 总共收到的字节数。
12070
+ * @hidden
11894
12071
  */
11895
12072
  /** {en}
11896
- * @brief The total number of bytes received.
12073
+ * @hidden
11897
12074
  */
11898
- totalReceivedByte: number;
12075
+ videoCodec: string;
11899
12076
  /** {zh}
11900
- * @brief 接收所有字节消耗时长。
12077
+ * @brief 视频宽度。
11901
12078
  */
11902
12079
  /** {en}
11903
- * @brief The time consumed for receiving all bytes.
12080
+ * @brief Video wight.
11904
12081
  */
11905
- totalReceivedCost: number;
12082
+ width: number;
11906
12083
  }
11907
12084
  /** {zh}
11908
12085
  * @detail api
@@ -11915,6 +12092,7 @@ declare namespace live {
11915
12092
  * @inheritdoc
11916
12093
  */
11917
12094
  class VePlayerLive extends VePlayerBase {
12095
+ _protocolManager?: ProtocolManager;
11918
12096
  /** {zh}
11919
12097
  * @hidden
11920
12098
  * @param options
@@ -12044,14 +12222,28 @@ declare namespace live {
12044
12222
  * @brief Obtain the playback information of FLV pull streaming.
12045
12223
  */
12046
12224
  getFLVStats(): FlvStats;
12047
- /** {zh}
12048
- * @brief 获取 HLS 拉流的播放信息。
12049
- * @returns
12050
- */
12051
- /** {en}
12052
- * @brief Obtain the playback information of HLS pull streaming.
12053
- */
12054
- 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>;
12055
12247
  }
12056
12248
  /** {zh}
12057
12249
  * @detail api