@volcengine/veplayer 2.8.1-rc.0 → 2.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/umd/veplayer.d.ts CHANGED
@@ -516,6 +516,16 @@ declare enum Level {
516
516
  */
517
517
  Warn = "Warn"
518
518
  }
519
+ /** {zh}
520
+ * @detail error
521
+ * @id errorcode
522
+ * @hidden
523
+ */
524
+ /** {en}
525
+ * @detail error
526
+ * @id errorcode
527
+ * @hidden
528
+ */
519
529
  declare enum ErrorCode {
520
530
  /** {zh}
521
531
  * @brief 视频解析错误
@@ -1729,15 +1739,15 @@ interface Poster {
1729
1739
  */
1730
1740
  isEndedShow?: boolean;
1731
1741
  /** {zh}
1732
- * @brief 是否播放后再隐藏封面图。
1733
- * - `true`:播放后隐藏,未启播时一直显示封面图。
1734
- * - `false`:在 `play` 事件触发后隐藏封面图。
1742
+ * @brief 是否在播放后隐藏封面图。
1743
+ * - `true`:在播放器开始播放(即画面可见)后隐藏封面图,播放前始终显示,避免黑屏;
1744
+ * - `false`:在触发 `play` 事件时立即隐藏封面图,可能在画面显示前出现黑屏。
1735
1745
  * @default false
1736
1746
  */
1737
1747
  /** {en}
1738
- * @brief Whether to hide the cover image after `canplay` event.
1739
- * - `true`:hide the cover image after `canplay` event.
1740
- * - `false`:hide the cover image after `play` event.
1748
+ * @brief Whether to hide the poster image after playback starts.
1749
+ * - `true`:The poster image remains visible until video playback actually starts (i.e., video frames are rendered), preventing a black screen before playback.
1750
+ * - `false`:The poster image is hidden immediately when the `play` event is triggered, which may cause a brief black screen before video appears.
1741
1751
  * @default false
1742
1752
  */
1743
1753
  hideCanplay?: boolean;
@@ -1751,18 +1761,18 @@ interface Poster {
1751
1761
  */
1752
1762
  notHidden?: boolean;
1753
1763
  /** {zh}
1754
- * @brief 封面图填充方式。取值如下:
1755
- * - `fixWidth`:宽度方向填充,不会被拉伸压缩。
1756
- * - `fixHeight`:高度方向填充,不会被拉伸压缩。
1757
- * - `cover`:完全覆盖容器,多余部分会被裁剪。
1758
- * - `contain`:完全覆盖,与容器不匹配时会被拉伸压缩。
1764
+ * @brief 封面图的填充方式,取值如下所示。
1765
+ * - `fixWidth`:按宽度适配容器,高度等比缩放,图像不拉伸压缩;
1766
+ * - `fixHeight`:按高度适配容器,宽度等比缩放,图像不拉伸压缩;
1767
+ * - `cover`:等比缩放并裁剪,使封面图完整覆盖容器,不留黑边;
1768
+ * - `contain`:等比缩放并拉伸,使封面图完整覆盖容器,不留黑边,可能失真。
1759
1769
  */
1760
1770
  /** {en}
1761
- * @brief Cover image fill mode.
1762
- * - `fixWidth`:Fill the width of the container and crop the height if necessary.
1763
- * - `fixHeight`:Fill the height of the container and crop the width if necessary.
1764
- * - `cover`:Fill the entire container while keeping the original aspect ratio.
1765
- * - `contain`:Stretch the video to fill the container.
1771
+ * @brief Fill mode of the poster image. The available options are as follows:
1772
+ * - `fixWidth`:Scales the image to fit the container's width while maintaining aspect ratio. Height is scaled proportionally, which may leave vertical blank space.
1773
+ * - `fixHeight`:Scales the image to fit the container's height while maintaining aspect ratio. Width is scaled proportionally, which may leave horizontal blank space.
1774
+ * - `cover`:Scales the image proportionally and crops overflow to fully cover the container without black borders.
1775
+ * - `contain`:Scales the image to fully fit the container. May stretch non-proportionally to avoid black borders, potentially causing distortion.
1766
1776
  */
1767
1777
  fillMode?: "fixWidth" | "fixHeight" | "cover" | "contain";
1768
1778
  }
@@ -3027,6 +3037,16 @@ declare namespace strategy {
3027
3037
  */
3028
3038
  Warn = "Warn"
3029
3039
  }
3040
+ /** {zh}
3041
+ * @detail error
3042
+ * @id errorcode
3043
+ * @hidden
3044
+ */
3045
+ /** {en}
3046
+ * @detail error
3047
+ * @id errorcode
3048
+ * @hidden
3049
+ */
3030
3050
  enum ErrorCode {
3031
3051
  /** {zh}
3032
3052
  * @brief 视频解析错误
@@ -4244,15 +4264,15 @@ declare namespace strategy {
4244
4264
  */
4245
4265
  isEndedShow?: boolean;
4246
4266
  /** {zh}
4247
- * @brief 是否播放后再隐藏封面图。
4248
- * - `true`:播放后隐藏,未启播时一直显示封面图。
4249
- * - `false`:在 `play` 事件触发后隐藏封面图。
4267
+ * @brief 是否在播放后隐藏封面图。
4268
+ * - `true`:在播放器开始播放(即画面可见)后隐藏封面图,播放前始终显示,避免黑屏;
4269
+ * - `false`:在触发 `play` 事件时立即隐藏封面图,可能在画面显示前出现黑屏。
4250
4270
  * @default false
4251
4271
  */
4252
4272
  /** {en}
4253
- * @brief Whether to hide the cover image after `canplay` event.
4254
- * - `true`:hide the cover image after `canplay` event.
4255
- * - `false`:hide the cover image after `play` event.
4273
+ * @brief Whether to hide the poster image after playback starts.
4274
+ * - `true`:The poster image remains visible until video playback actually starts (i.e., video frames are rendered), preventing a black screen before playback.
4275
+ * - `false`:The poster image is hidden immediately when the `play` event is triggered, which may cause a brief black screen before video appears.
4256
4276
  * @default false
4257
4277
  */
4258
4278
  hideCanplay?: boolean;
@@ -4266,18 +4286,18 @@ declare namespace strategy {
4266
4286
  */
4267
4287
  notHidden?: boolean;
4268
4288
  /** {zh}
4269
- * @brief 封面图填充方式。取值如下:
4270
- * - `fixWidth`:宽度方向填充,不会被拉伸压缩。
4271
- * - `fixHeight`:高度方向填充,不会被拉伸压缩。
4272
- * - `cover`:完全覆盖容器,多余部分会被裁剪。
4273
- * - `contain`:完全覆盖,与容器不匹配时会被拉伸压缩。
4289
+ * @brief 封面图的填充方式,取值如下所示。
4290
+ * - `fixWidth`:按宽度适配容器,高度等比缩放,图像不拉伸压缩;
4291
+ * - `fixHeight`:按高度适配容器,宽度等比缩放,图像不拉伸压缩;
4292
+ * - `cover`:等比缩放并裁剪,使封面图完整覆盖容器,不留黑边;
4293
+ * - `contain`:等比缩放并拉伸,使封面图完整覆盖容器,不留黑边,可能失真。
4274
4294
  */
4275
4295
  /** {en}
4276
- * @brief Cover image fill mode.
4277
- * - `fixWidth`:Fill the width of the container and crop the height if necessary.
4278
- * - `fixHeight`:Fill the height of the container and crop the width if necessary.
4279
- * - `cover`:Fill the entire container while keeping the original aspect ratio.
4280
- * - `contain`:Stretch the video to fill the container.
4296
+ * @brief Fill mode of the poster image. The available options are as follows:
4297
+ * - `fixWidth`:Scales the image to fit the container's width while maintaining aspect ratio. Height is scaled proportionally, which may leave vertical blank space.
4298
+ * - `fixHeight`:Scales the image to fit the container's height while maintaining aspect ratio. Width is scaled proportionally, which may leave horizontal blank space.
4299
+ * - `cover`:Scales the image proportionally and crops overflow to fully cover the container without black borders.
4300
+ * - `contain`:Scales the image to fully fit the container. May stretch non-proportionally to avoid black borders, potentially causing distortion.
4281
4301
  */
4282
4302
  fillMode?: "fixWidth" | "fixHeight" | "cover" | "contain";
4283
4303
  }
@@ -4818,6 +4838,16 @@ declare namespace error {
4818
4838
  */
4819
4839
  Warn = "Warn"
4820
4840
  }
4841
+ /** {zh}
4842
+ * @detail error
4843
+ * @id errorcode
4844
+ * @hidden
4845
+ */
4846
+ /** {en}
4847
+ * @detail error
4848
+ * @id errorcode
4849
+ * @hidden
4850
+ */
4821
4851
  enum ErrorCode {
4822
4852
  /** {zh}
4823
4853
  * @brief 视频解析错误
@@ -5655,7 +5685,6 @@ interface LoggerConfig {
5655
5685
  }
5656
5686
  /** {zh}
5657
5687
  * 高级能力(策略)名称
5658
- * @detail Options
5659
5688
  * @brief 策略名称
5660
5689
  */
5661
5690
  declare enum StrategyNames {
@@ -5682,7 +5711,6 @@ declare enum StrategyNames {
5682
5711
  }
5683
5712
  /** {zh}
5684
5713
  * 播放器预初始化配置
5685
- * @detail Options
5686
5714
  */
5687
5715
  type StrategyInitOptions<T = Record<string, Partial<VeStrategyConfig> | boolean>> = {
5688
5716
  /**
@@ -5782,6 +5810,7 @@ interface ErrorFallbackStrategy {
5782
5810
  */
5783
5811
  /** {en}
5784
5812
  * @brief Type of fallback. Specifies whether fallback is automatic or manually controlled.
5813
+ * @hidden
5785
5814
  */
5786
5815
  type?: FallbackKind;
5787
5816
  /** {zh}
@@ -5882,15 +5911,56 @@ declare class ProtocolManager {
5882
5911
  private _init;
5883
5912
  private _initSingleProtocol;
5884
5913
  }
5914
+ /** {zh}
5915
+ * @list option
5916
+ * @kind property
5917
+ */
5918
+ /** {en}
5919
+ * @list option
5920
+ * @kind property
5921
+ */
5885
5922
  interface PrepareOptions {
5923
+ /** {zh}
5924
+ * @brief 应用 ID,登录[视频直播控制台 > SDK 管理](https://console.volcengine.com/live/main/sdk)查询。
5925
+ */
5926
+ /** {en}
5927
+ * @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).
5928
+ */
5886
5929
  appId: string;
5930
+ /** {zh}
5931
+ * @brief 用于识别单一用户的 ID,如不设置,会随机生成一个用户 ID 存在浏览器缓存中。
5932
+ * @listtip
5933
+ * 建议您使用与业务相关的用户 ID,以便在发生播放错误时快速定位排查问题。
5934
+ */
5935
+ /** {en}
5936
+ * @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.
5937
+ * @listtip
5938
+ * We recommend using a business-related user ID to quickly locate and troubleshoot problems in the event of playback errors.
5939
+ */
5887
5940
  userId?: string;
5941
+ /** {zh}
5942
+ * @hidden
5943
+ */
5944
+ /** {en}
5945
+ * @hidden
5946
+ */
5888
5947
  deviceId?: string;
5889
- strategies: RtmAdaptiveBufferStrategy;
5948
+ /** {zh}
5949
+ * @brief 播放策略配置。
5950
+ */
5951
+ /** {en}
5952
+ * @brief Playback Strategy Configuration.
5953
+ */
5954
+ strategies: {
5955
+ /** {zh}
5956
+ * @brief 是否开启 RTM buffer 自适应策略。
5957
+ */
5958
+ /** {en}
5959
+ * @brief Enable RTM buffer adaptive strategy.
5960
+ */
5961
+ rtmAdaptiveBuffer?: boolean;
5962
+ };
5890
5963
  }
5891
- type RtmAdaptiveBufferStrategy = {
5892
- rtmAdaptiveBuffer?: boolean;
5893
- };
5894
5964
  /** {zh}
5895
5965
  * @list option
5896
5966
  * @kind property
@@ -6019,6 +6089,7 @@ interface Fallback {
6019
6089
  */
6020
6090
  /** {en}
6021
6091
  * @brief Whether to enable protocol fallback.
6092
+ * @hidden
6022
6093
  */
6023
6094
  enableFallback?: boolean;
6024
6095
  /** {zh}
@@ -6056,6 +6127,9 @@ interface FallbackStrategy {
6056
6127
  /** {zh}
6057
6128
  * @brief 拉流报错时降级策略
6058
6129
  */
6130
+ /** {en}
6131
+ * @brief The protocol downgrade strategy when a pull stream encounters an error.
6132
+ */
6059
6133
  [FallbackKind.Error]?: ErrorFallbackStrategy;
6060
6134
  /**
6061
6135
  * @hidden
@@ -6186,13 +6260,25 @@ interface HlsAbr {
6186
6260
  */
6187
6261
  interface Drm {
6188
6262
  /** {zh}
6189
- * @brief FairPlay DRM 配置。
6263
+ * @brief 配置 FairPlay DRM 参数,用于在 Apple 系统中播放加密内容。
6190
6264
  */
6191
6265
  /** {en}
6192
- * @brief FairPlay DRM configurations.
6266
+ * @brief FairPlay DRM configuration, used for encrypted content playback on Apple devices.
6193
6267
  */
6194
6268
  fairplay?: FairplayDrm;
6269
+ /** {zh}
6270
+ * @brief Widevine DRM 配置。
6271
+ */
6272
+ /** {en}
6273
+ * @brief Widevine DRM configurations.
6274
+ */
6195
6275
  widevine?: WidevineDrm;
6276
+ /** {zh}
6277
+ * @brief 配置 PlayReady DRM 参数,用于支持在 Windows/Edge 等环境中播放加密内容。
6278
+ */
6279
+ /** {en}
6280
+ * @brief PlayReady DRM configuration, used for encrypted content playback on Windows/Edge.
6281
+ */
6196
6282
  playready?: PlayreadyDrm;
6197
6283
  }
6198
6284
  /** {zh}
@@ -6229,10 +6315,10 @@ interface FairplayDrm {
6229
6315
  */
6230
6316
  interface WidevineDrm {
6231
6317
  /** {zh}
6232
- * @hidden
6318
+ * @brief 获取内容密钥许可证的请求地址。
6233
6319
  */
6234
6320
  /** {en}
6235
- * @hidden
6321
+ * @brief URL used to acquire the DRM license.
6236
6322
  */
6237
6323
  // [x: string]: string | undefined;
6238
6324
  /** {zh}
@@ -6253,7 +6339,7 @@ interface WidevineDrm {
6253
6339
  */
6254
6340
  interface PlayreadyDrm {
6255
6341
  /**
6256
- * @hidden
6342
+ * @brief 获取内容密钥许可证的请求地址。
6257
6343
  */
6258
6344
  // [x: string]: string | undefined;
6259
6345
  /** {zh}
@@ -6416,11 +6502,13 @@ interface Rtm {
6416
6502
  * - 未指定 `fallbackUrl`:当前环境不支持播放 RTM 或 RTM 拉流建联失败时,根据当前 RTM 地址降级到对应的 FLV 或者 HLS 地址。
6417
6503
  * @listtip - v2.5.2 版本后未指定 `fallbackUrl` 且未开启自动转码的情况下,不会自动降级到 FLV 或者 HLS 地址。
6418
6504
  * - 多线路和多清晰禁止插件内部自动降级, 具体降级方式查看 [RTM 协议拉流](https://www.volcengine.com/docs/6469/1548474)。
6505
+ * @hidden
6419
6506
  */
6420
6507
  /** {en}
6421
6508
  * @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`.
6422
6509
  * - If `fallbackUrl` is specified, in the event of a failed RTM pull-stream connection, the player will switch to the specified fallback address.
6423
6510
  * - If `fallbackUrl` is not specified, in the event of a failed RTM pull-stream connection, the player will switch to the corresponding FLV or HLS address.
6511
+ * @hidden
6424
6512
  */
6425
6513
  fallbackUrl?: string;
6426
6514
  /** {zh}
@@ -6515,17 +6603,20 @@ interface Rtm {
6515
6603
  */
6516
6604
  delayHint?: number;
6517
6605
  /** {zh}
6518
- * @brief RTM 建联后将在达到该阈值后检测数据接收是否异常,如果异常则播放器报错,单位毫秒。
6606
+ * @brief RTM 拉流建联成功后延迟指定时间开始检测数据接收情况,单位为毫秒。取值范围为 [5000,10000]。若在此时间内未成功接收到数据,则触发播放错误
6519
6607
  * @default 5000
6520
6608
  */
6521
6609
  /** {en}
6522
- * @brief After RTM connection is established, the system will detect abnormal data reception once the threshold (in milliseconds) is reached. If anomalies occur, the player triggers an error.
6610
+ * @brief After the RTM streaming connection is successfully established, the player delays for a specified period (in milliseconds) before checking if data is successfully received. If no data is received within this period, a playback error will be triggered.
6523
6611
  * @default 5000
6524
6612
  */
6525
6613
  checkStatsErrorDelay?: number;
6526
6614
  /** {zh}
6527
6615
  * @brief 是否打开 RTM SEI
6528
6616
  */
6617
+ /** {en}
6618
+ * @brief enable RTM SEI data.
6619
+ */
6529
6620
  enableSei?: boolean;
6530
6621
  }
6531
6622
  /** {zh}
@@ -7932,6 +8023,16 @@ declare namespace live {
7932
8023
  */
7933
8024
  Warn = "Warn"
7934
8025
  }
8026
+ /** {zh}
8027
+ * @detail error
8028
+ * @id errorcode
8029
+ * @hidden
8030
+ */
8031
+ /** {en}
8032
+ * @detail error
8033
+ * @id errorcode
8034
+ * @hidden
8035
+ */
7935
8036
  enum ErrorCode {
7936
8037
  /** {zh}
7937
8038
  * @brief 视频解析错误
@@ -9149,15 +9250,15 @@ declare namespace live {
9149
9250
  */
9150
9251
  isEndedShow?: boolean;
9151
9252
  /** {zh}
9152
- * @brief 是否播放后再隐藏封面图。
9153
- * - `true`:播放后隐藏,未启播时一直显示封面图。
9154
- * - `false`:在 `play` 事件触发后隐藏封面图。
9253
+ * @brief 是否在播放后隐藏封面图。
9254
+ * - `true`:在播放器开始播放(即画面可见)后隐藏封面图,播放前始终显示,避免黑屏;
9255
+ * - `false`:在触发 `play` 事件时立即隐藏封面图,可能在画面显示前出现黑屏。
9155
9256
  * @default false
9156
9257
  */
9157
9258
  /** {en}
9158
- * @brief Whether to hide the cover image after `canplay` event.
9159
- * - `true`:hide the cover image after `canplay` event.
9160
- * - `false`:hide the cover image after `play` event.
9259
+ * @brief Whether to hide the poster image after playback starts.
9260
+ * - `true`:The poster image remains visible until video playback actually starts (i.e., video frames are rendered), preventing a black screen before playback.
9261
+ * - `false`:The poster image is hidden immediately when the `play` event is triggered, which may cause a brief black screen before video appears.
9161
9262
  * @default false
9162
9263
  */
9163
9264
  hideCanplay?: boolean;
@@ -9171,18 +9272,18 @@ declare namespace live {
9171
9272
  */
9172
9273
  notHidden?: boolean;
9173
9274
  /** {zh}
9174
- * @brief 封面图填充方式。取值如下:
9175
- * - `fixWidth`:宽度方向填充,不会被拉伸压缩。
9176
- * - `fixHeight`:高度方向填充,不会被拉伸压缩。
9177
- * - `cover`:完全覆盖容器,多余部分会被裁剪。
9178
- * - `contain`:完全覆盖,与容器不匹配时会被拉伸压缩。
9275
+ * @brief 封面图的填充方式,取值如下所示。
9276
+ * - `fixWidth`:按宽度适配容器,高度等比缩放,图像不拉伸压缩;
9277
+ * - `fixHeight`:按高度适配容器,宽度等比缩放,图像不拉伸压缩;
9278
+ * - `cover`:等比缩放并裁剪,使封面图完整覆盖容器,不留黑边;
9279
+ * - `contain`:等比缩放并拉伸,使封面图完整覆盖容器,不留黑边,可能失真。
9179
9280
  */
9180
9281
  /** {en}
9181
- * @brief Cover image fill mode.
9182
- * - `fixWidth`:Fill the width of the container and crop the height if necessary.
9183
- * - `fixHeight`:Fill the height of the container and crop the width if necessary.
9184
- * - `cover`:Fill the entire container while keeping the original aspect ratio.
9185
- * - `contain`:Stretch the video to fill the container.
9282
+ * @brief Fill mode of the poster image. The available options are as follows:
9283
+ * - `fixWidth`:Scales the image to fit the container's width while maintaining aspect ratio. Height is scaled proportionally, which may leave vertical blank space.
9284
+ * - `fixHeight`:Scales the image to fit the container's height while maintaining aspect ratio. Width is scaled proportionally, which may leave horizontal blank space.
9285
+ * - `cover`:Scales the image proportionally and crops overflow to fully cover the container without black borders.
9286
+ * - `contain`:Scales the image to fully fit the container. May stretch non-proportionally to avoid black borders, potentially causing distortion.
9186
9287
  */
9187
9288
  fillMode?: "fixWidth" | "fixHeight" | "cover" | "contain";
9188
9289
  }
@@ -10462,7 +10563,6 @@ declare namespace live {
10462
10563
  }
10463
10564
  /** {zh}
10464
10565
  * 高级能力(策略)名称
10465
- * @detail Options
10466
10566
  * @brief 策略名称
10467
10567
  */
10468
10568
  enum StrategyNames {
@@ -10489,7 +10589,6 @@ declare namespace live {
10489
10589
  }
10490
10590
  /** {zh}
10491
10591
  * 播放器预初始化配置
10492
- * @detail Options
10493
10592
  */
10494
10593
  type StrategyInitOptions<T = Record<string, Partial<VeStrategyConfig> | boolean>> = {
10495
10594
  /**
@@ -10615,6 +10714,7 @@ declare namespace live {
10615
10714
  */
10616
10715
  /** {en}
10617
10716
  * @brief Type of fallback. Specifies whether fallback is automatic or manually controlled.
10717
+ * @hidden
10618
10718
  */
10619
10719
  type?: FallbackKind;
10620
10720
  /** {zh}
@@ -10715,15 +10815,56 @@ declare namespace live {
10715
10815
  private _init;
10716
10816
  private _initSingleProtocol;
10717
10817
  }
10818
+ /** {zh}
10819
+ * @list option
10820
+ * @kind property
10821
+ */
10822
+ /** {en}
10823
+ * @list option
10824
+ * @kind property
10825
+ */
10718
10826
  interface PrepareOptions {
10827
+ /** {zh}
10828
+ * @brief 应用 ID,登录[视频直播控制台 > SDK 管理](https://console.volcengine.com/live/main/sdk)查询。
10829
+ */
10830
+ /** {en}
10831
+ * @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).
10832
+ */
10719
10833
  appId: string;
10834
+ /** {zh}
10835
+ * @brief 用于识别单一用户的 ID,如不设置,会随机生成一个用户 ID 存在浏览器缓存中。
10836
+ * @listtip
10837
+ * 建议您使用与业务相关的用户 ID,以便在发生播放错误时快速定位排查问题。
10838
+ */
10839
+ /** {en}
10840
+ * @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.
10841
+ * @listtip
10842
+ * We recommend using a business-related user ID to quickly locate and troubleshoot problems in the event of playback errors.
10843
+ */
10720
10844
  userId?: string;
10845
+ /** {zh}
10846
+ * @hidden
10847
+ */
10848
+ /** {en}
10849
+ * @hidden
10850
+ */
10721
10851
  deviceId?: string;
10722
- strategies: RtmAdaptiveBufferStrategy;
10852
+ /** {zh}
10853
+ * @brief 播放策略配置。
10854
+ */
10855
+ /** {en}
10856
+ * @brief Playback Strategy Configuration.
10857
+ */
10858
+ strategies: {
10859
+ /** {zh}
10860
+ * @brief 是否开启 RTM buffer 自适应策略。
10861
+ */
10862
+ /** {en}
10863
+ * @brief Enable RTM buffer adaptive strategy.
10864
+ */
10865
+ rtmAdaptiveBuffer?: boolean;
10866
+ };
10723
10867
  }
10724
- type RtmAdaptiveBufferStrategy = {
10725
- rtmAdaptiveBuffer?: boolean;
10726
- };
10727
10868
  /** {zh}
10728
10869
  * @list option
10729
10870
  * @kind property
@@ -10852,6 +10993,7 @@ declare namespace live {
10852
10993
  */
10853
10994
  /** {en}
10854
10995
  * @brief Whether to enable protocol fallback.
10996
+ * @hidden
10855
10997
  */
10856
10998
  enableFallback?: boolean;
10857
10999
  /** {zh}
@@ -10889,6 +11031,9 @@ declare namespace live {
10889
11031
  /** {zh}
10890
11032
  * @brief 拉流报错时降级策略
10891
11033
  */
11034
+ /** {en}
11035
+ * @brief The protocol downgrade strategy when a pull stream encounters an error.
11036
+ */
10892
11037
  [FallbackKind.Error]?: ErrorFallbackStrategy;
10893
11038
  /**
10894
11039
  * @hidden
@@ -11019,13 +11164,25 @@ declare namespace live {
11019
11164
  */
11020
11165
  interface Drm {
11021
11166
  /** {zh}
11022
- * @brief FairPlay DRM 配置。
11167
+ * @brief 配置 FairPlay DRM 参数,用于在 Apple 系统中播放加密内容。
11023
11168
  */
11024
11169
  /** {en}
11025
- * @brief FairPlay DRM configurations.
11170
+ * @brief FairPlay DRM configuration, used for encrypted content playback on Apple devices.
11026
11171
  */
11027
11172
  fairplay?: FairplayDrm;
11173
+ /** {zh}
11174
+ * @brief Widevine DRM 配置。
11175
+ */
11176
+ /** {en}
11177
+ * @brief Widevine DRM configurations.
11178
+ */
11028
11179
  widevine?: WidevineDrm;
11180
+ /** {zh}
11181
+ * @brief 配置 PlayReady DRM 参数,用于支持在 Windows/Edge 等环境中播放加密内容。
11182
+ */
11183
+ /** {en}
11184
+ * @brief PlayReady DRM configuration, used for encrypted content playback on Windows/Edge.
11185
+ */
11029
11186
  playready?: PlayreadyDrm;
11030
11187
  }
11031
11188
  /** {zh}
@@ -11062,10 +11219,10 @@ declare namespace live {
11062
11219
  */
11063
11220
  interface WidevineDrm {
11064
11221
  /** {zh}
11065
- * @hidden
11222
+ * @brief 获取内容密钥许可证的请求地址。
11066
11223
  */
11067
11224
  /** {en}
11068
- * @hidden
11225
+ * @brief URL used to acquire the DRM license.
11069
11226
  */
11070
11227
  // [x: string]: string | undefined;
11071
11228
  /** {zh}
@@ -11086,7 +11243,7 @@ declare namespace live {
11086
11243
  */
11087
11244
  interface PlayreadyDrm {
11088
11245
  /**
11089
- * @hidden
11246
+ * @brief 获取内容密钥许可证的请求地址。
11090
11247
  */
11091
11248
  // [x: string]: string | undefined;
11092
11249
  /** {zh}
@@ -11249,11 +11406,13 @@ declare namespace live {
11249
11406
  * - 未指定 `fallbackUrl`:当前环境不支持播放 RTM 或 RTM 拉流建联失败时,根据当前 RTM 地址降级到对应的 FLV 或者 HLS 地址。
11250
11407
  * @listtip - v2.5.2 版本后未指定 `fallbackUrl` 且未开启自动转码的情况下,不会自动降级到 FLV 或者 HLS 地址。
11251
11408
  * - 多线路和多清晰禁止插件内部自动降级, 具体降级方式查看 [RTM 协议拉流](https://www.volcengine.com/docs/6469/1548474)。
11409
+ * @hidden
11252
11410
  */
11253
11411
  /** {en}
11254
11412
  * @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`.
11255
11413
  * - If `fallbackUrl` is specified, in the event of a failed RTM pull-stream connection, the player will switch to the specified fallback address.
11256
11414
  * - If `fallbackUrl` is not specified, in the event of a failed RTM pull-stream connection, the player will switch to the corresponding FLV or HLS address.
11415
+ * @hidden
11257
11416
  */
11258
11417
  fallbackUrl?: string;
11259
11418
  /** {zh}
@@ -11348,17 +11507,20 @@ declare namespace live {
11348
11507
  */
11349
11508
  delayHint?: number;
11350
11509
  /** {zh}
11351
- * @brief RTM 建联后将在达到该阈值后检测数据接收是否异常,如果异常则播放器报错,单位毫秒。
11510
+ * @brief RTM 拉流建联成功后延迟指定时间开始检测数据接收情况,单位为毫秒。取值范围为 [5000,10000]。若在此时间内未成功接收到数据,则触发播放错误
11352
11511
  * @default 5000
11353
11512
  */
11354
11513
  /** {en}
11355
- * @brief After RTM connection is established, the system will detect abnormal data reception once the threshold (in milliseconds) is reached. If anomalies occur, the player triggers an error.
11514
+ * @brief After the RTM streaming connection is successfully established, the player delays for a specified period (in milliseconds) before checking if data is successfully received. If no data is received within this period, a playback error will be triggered.
11356
11515
  * @default 5000
11357
11516
  */
11358
11517
  checkStatsErrorDelay?: number;
11359
11518
  /** {zh}
11360
11519
  * @brief 是否打开 RTM SEI
11361
11520
  */
11521
+ /** {en}
11522
+ * @brief enable RTM SEI data.
11523
+ */
11362
11524
  enableSei?: boolean;
11363
11525
  }
11364
11526
  /** {zh}
@@ -12215,6 +12377,54 @@ declare namespace live {
12215
12377
  * @returns The player instance.
12216
12378
  */
12217
12379
  function createLivePlayer(options?: LiveVePlayerOptions): Promise<VePlayerLive>;
12380
+ /** {zh}
12381
+ * @detail api
12382
+ * @brief 初始化播放器策略。
12383
+ * @example
12384
+ * ```js
12385
+ * live.prepare({
12386
+ * appId: '***',
12387
+ * userId: '***',
12388
+ * strategies: {
12389
+ * rtmAdaptiveBuffer: true,
12390
+ * },
12391
+ * }).then(function () {
12392
+ * VePlayer.createLivePlayer({
12393
+ * height: '300px',
12394
+ * url: 'https://pulldomain.com/appname/streamname.sdp',
12395
+ * logger: {
12396
+ * userId: '***',
12397
+ * appId: '***',
12398
+ * },
12399
+ * });
12400
+ * });
12401
+ * ```
12402
+ * @param options 配置策略参数。
12403
+ */
12404
+ /** {en}
12405
+ * @detail api
12406
+ * @brief Initialize player strategy.
12407
+ * @example
12408
+ * ```js
12409
+ * live.prepare({
12410
+ * appId: '***',
12411
+ * userId: '***',
12412
+ * strategies: {
12413
+ * rtmAdaptiveBuffer: true,
12414
+ * },
12415
+ * }).then(function () {
12416
+ * VePlayer.createLivePlayer({
12417
+ * height: '300px',
12418
+ * url: 'https://pulldomain.com/appname/streamname.sdp',
12419
+ * logger: {
12420
+ * userId: '***',
12421
+ * appId: '***',
12422
+ * },
12423
+ * });
12424
+ * });
12425
+ * ```
12426
+ * @param options Configure strategy parameters.
12427
+ */
12218
12428
  function prepare(options: PrepareOptions): Promise<VeStrategyManager | undefined>;
12219
12429
  /** {zh}
12220
12430
  * @detail events
@@ -12560,6 +12770,12 @@ declare namespace live {
12560
12770
  * @brief Event of failing to switch Adaptive Bitrate (ABR) live stream.
12561
12771
  */
12562
12772
  ABR_SWITCH_FAILED = "abrSwitchFailed",
12773
+ /** {en}
12774
+ * @hidden
12775
+ */
12776
+ /** {zh}
12777
+ * @hidden
12778
+ */
12563
12779
  RTM_NETWORK = "rtmNetwork"
12564
12780
  }
12565
12781
  /** {zh}
@@ -13170,6 +13386,12 @@ declare namespace live {
13170
13386
  */
13171
13387
  url: string;
13172
13388
  }) => void;
13389
+ /** {en}
13390
+ * @hidden
13391
+ */
13392
+ /** {zh}
13393
+ * @hidden
13394
+ */
13173
13395
  [LiveEvents.RTM_NETWORK]: (data: any) => void;
13174
13396
  }
13175
13397
  const Events: {