@volcengine/veplayer 1.19.2-rc.2 → 1.19.2-rc.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -7181,6 +7181,8 @@ export declare const enum LangTextKey {
7181
7181
  DRAMA_FAILED_TO_QUERY = "DRAMA_FAILED_TO_QUERY",
7182
7182
  DRAMA_INVALID_TTOP_TOKEN = "DRAMA_INVALID_TTOP_TOKEN",
7183
7183
  DRAMA_NOT_ON_SHELF = "DRAMA_NOT_ON_SHELF",
7184
+ DRAMA_EMPTY_PLAYLIST = "DRAMA_EMPTY_PLAYLIST",
7185
+ DRAMA_GET_INFO_TIMEOUT = "DRAMA_GET_INFO_TIMEOUT",
7184
7186
  DRAMA_FAILED_GET_EPISODE_INFO = "DRAMA_FAILED_GET_EPISODE_INFO"
7185
7187
  }
7186
7188
  declare const DRAMA_ERROR_CODE: {
@@ -7230,6 +7232,16 @@ declare const DRAMA_ERROR_CODE: {
7230
7232
  readonly message: "Video is not on shelf";
7231
7233
  readonly textKey: LangTextKey.DRAMA_NOT_ON_SHELF;
7232
7234
  };
7235
+ readonly EMPTY_PLAYLIST: {
7236
+ readonly code: 9311;
7237
+ readonly message: "Episode video playlist is empty";
7238
+ readonly textKey: LangTextKey.DRAMA_EMPTY_PLAYLIST;
7239
+ };
7240
+ readonly GET_INFO_TIMEOUT: {
7241
+ readonly code: 9312;
7242
+ readonly message: "getDramaInfo request timed out";
7243
+ readonly textKey: LangTextKey.DRAMA_GET_INFO_TIMEOUT;
7244
+ };
7233
7245
  readonly FAILED_GET_EPISODE_INFO: {
7234
7246
  readonly code: 9399;
7235
7247
  readonly message: "Failed get episode info";
@@ -7251,7 +7263,7 @@ declare class AuthToken extends SdkPlugin {
7251
7263
  playInfo?: VideoInfoRes;
7252
7264
  constructor(args: any);
7253
7265
  beforePlayerCreate(): Promise<void>;
7254
- getVideoInfo(sourceConfigs?: IPlayerConfig): Promise<{
7266
+ getVideoInfo(sourceConfigs?: IPlayerConfig, errors?: any[]): Promise<{
7255
7267
  vid: string;
7256
7268
  __mediaInfoCacheHit: boolean;
7257
7269
  __serverFetchDuration: number;
@@ -7260,10 +7272,11 @@ declare class AuthToken extends SdkPlugin {
7260
7272
  codec: ICodecType;
7261
7273
  defaultDefinition: string;
7262
7274
  }>;
7275
+ private reportEmptyDramaPlaylist;
7263
7276
  /**
7264
7277
  * 短剧 Minis 环境:通过 JSB getDramaInfo 获取媒体信息
7265
7278
  */
7266
- getDramaInfoViaJSB(sourceConfigs?: IPlayerConfig): Promise<VideoInfoRes | undefined>;
7279
+ getDramaInfoViaJSB(sourceConfigs?: IPlayerConfig, errors?: any[]): Promise<VideoInfoRes | undefined>;
7267
7280
  /**
7268
7281
  * 将审核状态映射到短剧错误码
7269
7282
  */
@@ -7282,7 +7295,7 @@ declare class AuthToken extends SdkPlugin {
7282
7295
  episodeId?: string;
7283
7296
  vid?: string;
7284
7297
  }): void;
7285
- getVideos(sourceConfigs?: IPlayerConfig): Promise<any>;
7298
+ getVideos(sourceConfigs?: IPlayerConfig, errors?: any[]): Promise<any>;
7286
7299
  getPrivateDrmInfo(playList: Stream[], vid: string, streamType: string): Promise<void>;
7287
7300
  getThumbnailConfig(thumbs: IThumbInfoItem[]): void;
7288
7301
  getBarrageMaskUrl(url: string): void;
@@ -7303,16 +7316,16 @@ declare class AuthToken extends SdkPlugin {
7303
7316
  /**
7304
7317
  * 剧集切换:configs 已由 player 更新 album_id/episode_id,重新拉取媒体信息
7305
7318
  */
7306
- updateDramaEpisode(isNewVideo: boolean, candidateConfig?: IPlayerConfig): Promise<void>;
7319
+ updateDramaEpisode(isNewVideo: boolean, candidateConfig?: IPlayerConfig, errors?: any[]): Promise<void>;
7307
7320
  /**
7308
7321
  * @description 更新playAuthToken
7309
7322
  * @param {IPlayAuthTokenConfig} getVideoByToken token信息
7310
7323
  * @param {boolean} isNewVideo 是否新视频,即是否为切换视频
7311
7324
  */
7312
7325
  updateAuthToken(getVideoByToken: IPlayAuthTokenConfig, isNewVideo: boolean): Promise<void>;
7313
- checkPlayAuthTokenValid(): boolean;
7314
- checkKeyTokenValid(): boolean;
7315
- checkDrmAuthTokenValid(): boolean;
7326
+ checkPlayAuthTokenValid(errors?: any[]): boolean;
7327
+ checkKeyTokenValid(errors?: any[]): boolean;
7328
+ checkDrmAuthTokenValid(errors?: any[]): boolean;
7316
7329
  }
7317
7330
  /** {zh}
7318
7331
  * @hidden
@@ -7692,7 +7705,7 @@ declare class PlayerData {
7692
7705
  /**
7693
7706
  * @description: 获取当前的streamType
7694
7707
  */
7695
- getCurrentStreamType(): string;
7708
+ getCurrentStreamType(fallback?: string): string;
7696
7709
  getStreamType(): string;
7697
7710
  getConfiguredHlsAbrEngine(): HlsAbrEngine;
7698
7711
  isOpenVePlayerABR(): boolean;
@@ -7932,6 +7945,20 @@ export declare type IPreloadUpdateConfig = {
7932
7945
  * @detail Options
7933
7946
  */
7934
7947
  export declare type IPreloadResolvedStream = {
7948
+ /** {zh}
7949
+ * @brief HLS 分片数量,覆盖 strategies.preload.sn。
7950
+ */
7951
+ /** {en}
7952
+ * @brief HLS segment count; overrides strategies.preload.sn.
7953
+ */
7954
+ sn?: number;
7955
+ /** {zh}
7956
+ * @brief HLS master 子列表索引,覆盖 strategies.preload.level。
7957
+ */
7958
+ /** {en}
7959
+ * @brief Zero-based HLS master variant index; overrides strategies.preload.level.
7960
+ */
7961
+ level?: number;
7935
7962
  /** {zh}
7936
7963
  * @brief 视频 ID
7937
7964
  */
@@ -8118,16 +8145,30 @@ export declare type IPreloadConfig = {
8118
8145
  */
8119
8146
  preloadScene?: PreloadScene;
8120
8147
  /** {zh}
8121
- * @brief 视频格式
8148
+ * @brief 预加载格式,可传数组以同时初始化 MP4 和 HLS。
8122
8149
  * - mp4: mp4格式
8123
8150
  * - hls: hls格式
8124
8151
  * @default mp4
8125
8152
  */
8126
8153
  /** {en}
8127
- * @brief Video format.
8154
+ * @brief Preload format. An array initializes both MP4 and HLS.
8128
8155
  * @default mp4
8129
8156
  */
8130
- format?: PreloadFormat;
8157
+ format?: PreloadFormat | PreloadFormat[];
8158
+ /** {zh}
8159
+ * @brief HLS 预载分片数量,正整数,默认 2。
8160
+ */
8161
+ /** {en}
8162
+ * @brief Number of HLS segments to preload. Positive integer; defaults to 2.
8163
+ */
8164
+ sn?: number;
8165
+ /** {zh}
8166
+ * @brief HLS master 子列表索引,从 0 开始,默认 0。
8167
+ */
8168
+ /** {en}
8169
+ * @brief Zero-based HLS master variant index; defaults to 0.
8170
+ */
8171
+ level?: number;
8131
8172
  /** {zh}
8132
8173
  * 向前预加载视频个数,Feed流场景时生效
8133
8174
  * @default 1
@@ -8759,6 +8800,23 @@ declare class VePlayer {
8759
8800
  * ```
8760
8801
  */
8761
8802
  static prefetchMediaInfo(sources: IMediaInfoPrefetchSource[]): Promise<IMediaInfoPrefetchResult[]>;
8803
+ /** {zh}
8804
+ * @brief 全局设置是否为 MSE 媒体请求添加 x-tt-trace-id,默认关闭。
8805
+ * @param enable - 是否开启。新建播放器或下一次 playNext 时生效,当前播放保持原设置。
8806
+ * @notes 开启前需确保 CDN 的 CORS 配置允许 x-tt-trace-id。独立预加载不添加该请求头。
8807
+ * @example
8808
+ * VePlayer.setMediaTraceEnabled(true);
8809
+ * @list Api
8810
+ */
8811
+ /** {en}
8812
+ * @brief Globally enable x-tt-trace-id on MSE media requests. Disabled by default.
8813
+ * @param enable - Applies to new players and the next playNext; the current playback is unchanged.
8814
+ * @notes The CDN must allow x-tt-trace-id in CORS. Independent preloads do not include this header.
8815
+ * @example
8816
+ * VePlayer.setMediaTraceEnabled(true);
8817
+ * @list Api
8818
+ */
8819
+ static setMediaTraceEnabled(enable: boolean): void;
8762
8820
  /** {zh}
8763
8821
  * @brief 设置全局日志开关。开启后会输出 VE_DEBUG.log 级别日志。
8764
8822
  * @param enable 是否开启详细日志
@@ -9316,6 +9374,7 @@ declare class VePlayer {
9316
9374
  * @memberof VePlayer
9317
9375
  */
9318
9376
  updateAuthToken(config: IPlayAuthTokenConfig): Promise<void>;
9377
+ private _finishMediaPreparation;
9319
9378
  private _playerPlayNext;
9320
9379
  /** {zh}
9321
9380
  * @brief 返回当前视频的地址。
@@ -9395,6 +9454,7 @@ declare class VePlayer {
9395
9454
  private _buildDramaInvalidParamError;
9396
9455
  private _getDramaAlbumIdFromConfig;
9397
9456
  private _getDramaEpisodeIdFromConfig;
9457
+ private _reportPlayNextFailure;
9398
9458
  private switchDramaEpisode;
9399
9459
  /** {zh}
9400
9460
  * @brief 销毁xgplayer实例