@byteplus/veplayer 1.19.1 → 1.19.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -3350,6 +3350,15 @@ export interface IGetPlayInfoRes {
3350
3350
  * 短剧环境配置接口
3351
3351
  */
3352
3352
  export interface ITTDramaEnv {
3353
+ /** {zh}
3354
+ * @brief 首次 TTMinis.init 调用的 Unix 毫秒时间,用于计算首个视频的起播耗时。
3355
+ * @hidden
3356
+ */
3357
+ /** {en}
3358
+ * @brief Unix timestamp in milliseconds of the first TTMinis.init call, used for first-video startup duration.
3359
+ * @hidden
3360
+ */
3361
+ pageLoadStartTime?: number;
3353
3362
  /** 云服务商,默认从构建时 env.__PLATFORM__ 获取,未注入时默认为 byteplus */
3354
3363
  channel?: "volcengine" | "byteplus";
3355
3364
  /**
@@ -3446,18 +3455,41 @@ export interface IGetDramaInfoPerfInfo {
3446
3455
  * JSB 获取短剧信息返回结果
3447
3456
  */
3448
3457
  export interface IJSBCallbackResult {
3458
+ /** {zh} @brief Native 请求诊断;未知字段省略。 @hidden */
3459
+ /** {en} @brief Native request diagnostics; unavailable fields are omitted. @hidden */
3460
+ request_diagnostics?: Record<string, unknown>;
3461
+ /** {zh} @brief 剧集接口请求标识,获取到时提供。 @hidden */
3462
+ /** {en} @brief Drama request log ID, when available. @hidden */
3463
+ log_id?: string;
3464
+ /** {zh} @brief 旧回包的顶层 Native 通参;优先使用 data.tracking_context。 */
3465
+ /** {en} @brief Legacy top-level tracking fields; data.tracking_context takes priority. */
3466
+ tracking_context?: {
3467
+ enter_from?: string;
3468
+ minis_type?: string;
3469
+ minis_id?: string;
3470
+ ttoclid?: string;
3471
+ };
3449
3472
  is_success: number | boolean;
3450
3473
  error?: MinisError;
3451
3474
  data?: {
3475
+ /** {zh} @brief Native 埋点通参;缺失时不报对应字段。 */
3476
+ /** {en} @brief Native tracking fields; omitted fields are not reported. */
3477
+ tracking_context?: IJSBCallbackResult["tracking_context"];
3452
3478
  status: number;
3453
3479
  drama_info: {
3454
- album_id: string;
3455
- drama_name: string;
3456
- drama_cover: string;
3457
- drama_description: string;
3480
+ drama_id?: string;
3481
+ album_id?: string;
3482
+ album_name?: string;
3483
+ episode_total_num?: number;
3484
+ drama_name?: string;
3485
+ album_cover?: string;
3486
+ drama_cover?: string;
3487
+ album_description?: string;
3488
+ drama_description?: string;
3458
3489
  };
3459
3490
  episode_info: {
3460
3491
  episode_id: string;
3492
+ episode_current_num?: number;
3461
3493
  episode_name: string;
3462
3494
  episode_cover: string;
3463
3495
  episode_description: string;
@@ -4748,19 +4780,19 @@ export interface IPlayerConfig extends IPlayerOptions {
4748
4780
  /** {zh}
4749
4781
  * @brief 起播和 playNext 的 getDramaInfo JSB 超时与重试配置。
4750
4782
  * @list Options
4751
- * @notes timeout 和 retryInterval 单位为毫秒,默认 3000 和 1000;retryCount 默认 3,表示首次请求之外的重试次数。仅重试超时、调用异常及 is_success 为 false 的结果,不重试业务审核失败。timeout 必须大于 0,retryCount 为非负整数,retryInterval 为非负数;无效值回退默认值。
4783
+ * @notes timeout 和 retryInterval 单位为毫秒,默认 10000 和 1000;retryCount 默认 3,表示首次请求之外的重试次数。仅重试超时、调用异常及 is_success 为 false 的结果,不重试业务审核失败。timeout 必须大于 0,retryCount 为非负整数,retryInterval 为非负数;无效值回退默认值。
4752
4784
  * @example
4753
4785
  * ```javascript
4754
- * new VePlayer({ dramaInfoRequest: { timeout: 3000, retryCount: 3, retryInterval: 1000 } });
4786
+ * new VePlayer({ dramaInfoRequest: { timeout: 10000, retryCount: 3, retryInterval: 1000 } });
4755
4787
  * ```
4756
4788
  */
4757
4789
  /** {en}
4758
4790
  * @brief Configure getDramaInfo JSB timeouts and retries for startup and playNext.
4759
4791
  * @list Options
4760
- * @notes timeout and retryInterval are in milliseconds, defaulting to 3000 and 1000. retryCount defaults to 3 additional attempts. Only timeouts, invocation errors and is_success=false responses are retried; business review failures are not. timeout must be positive, retryCount a nonnegative integer and retryInterval nonnegative; invalid values use defaults.
4792
+ * @notes timeout and retryInterval are in milliseconds, defaulting to 10000 and 1000. retryCount defaults to 3 additional attempts. Only timeouts, invocation errors and is_success=false responses are retried; business review failures are not. timeout must be positive, retryCount a nonnegative integer and retryInterval nonnegative; invalid values use defaults.
4761
4793
  * @example
4762
4794
  * ```javascript
4763
- * new VePlayer({ dramaInfoRequest: { timeout: 3000, retryCount: 3, retryInterval: 1000 } });
4795
+ * new VePlayer({ dramaInfoRequest: { timeout: 10000, retryCount: 3, retryInterval: 1000 } });
4764
4796
  * ```
4765
4797
  */
4766
4798
  dramaInfoRequest?: {
@@ -7102,6 +7134,7 @@ export declare const enum LangTextKey {
7102
7134
  NETWORK_URL_EXPIRE = "NETWORK_URL_EXPIRE",
7103
7135
  NETWORK_URL_SIGN = "NETWORK_URL_SIGN",
7104
7136
  NETWORK_ENCRYPT_HLS_ERR = "NETWORK_ENCRYPT_HLS_ERR",
7137
+ DECODER_INIT_NOT_SUPPORTED = "DECODER_INIT_NOT_SUPPORTED",
7105
7138
  MEDIA_ERR = "MEDIA_ERR",
7106
7139
  MEDIA_ERR_ABORTED = "MEDIA_ERR_ABORTED",
7107
7140
  MEDIA_ERR_NETWORK = "MEDIA_ERR_NETWORK",
@@ -7154,6 +7187,48 @@ export declare const enum LangTextKey {
7154
7187
  DRAMA_FAILED_TO_QUERY = "DRAMA_FAILED_TO_QUERY",
7155
7188
  DRAMA_INVALID_TTOP_TOKEN = "DRAMA_INVALID_TTOP_TOKEN",
7156
7189
  DRAMA_NOT_ON_SHELF = "DRAMA_NOT_ON_SHELF",
7190
+ DRAMA_EMPTY_PLAYLIST = "DRAMA_EMPTY_PLAYLIST",
7191
+ DRAMA_GET_INFO_TIMEOUT = "DRAMA_GET_INFO_TIMEOUT",
7192
+ DRAMA_INVOKE_EXCEPTION = "DRAMA_INVOKE_EXCEPTION",
7193
+ DRAMA_BRIDGE_FAILURE = "DRAMA_BRIDGE_FAILURE",
7194
+ DRAMA_NATIVE_TIMEOUT = "DRAMA_NATIVE_TIMEOUT",
7195
+ DRAMA_NETWORK_FAILURE = "DRAMA_NETWORK_FAILURE",
7196
+ DRAMA_HTTP_FAILURE = "DRAMA_HTTP_FAILURE",
7197
+ DRAMA_SERVER_BUSINESS_FAILURE = "DRAMA_SERVER_BUSINESS_FAILURE",
7198
+ DRAMA_NATIVE_UNKNOWN = "DRAMA_NATIVE_UNKNOWN",
7199
+ DRAMA_EMPTY_CALLBACK = "DRAMA_EMPTY_CALLBACK",
7200
+ DRAMA_INVALID_RESPONSE = "DRAMA_INVALID_RESPONSE",
7201
+ DRAMA_INVALID_REVIEW_STATUS = "DRAMA_INVALID_REVIEW_STATUS",
7202
+ DRAMA_INVALID_VIDEO_INFO = "DRAMA_INVALID_VIDEO_INFO",
7203
+ DRAMA_MISSING_PLAYLIST = "DRAMA_MISSING_PLAYLIST",
7204
+ DRAMA_INVALID_PLAYLIST = "DRAMA_INVALID_PLAYLIST",
7205
+ DRAMA_INVALID_PLAY_ITEMS = "DRAMA_INVALID_PLAY_ITEMS",
7206
+ DRAMA_UNUSABLE_PLAY_URLS = "DRAMA_UNUSABLE_PLAY_URLS",
7207
+ DRAMA_NORMALIZED_PLAYLIST_EMPTY = "DRAMA_NORMALIZED_PLAYLIST_EMPTY",
7208
+ DRAMA_TRANSFORM_EXCEPTION = "DRAMA_TRANSFORM_EXCEPTION",
7209
+ DRAMA_ALBUM_ACCESS_DENIED = "DRAMA_ALBUM_ACCESS_DENIED",
7210
+ DRAMA_ALBUM_NOT_FOUND = "DRAMA_ALBUM_NOT_FOUND",
7211
+ DRAMA_REVIEW_RESULT_UNAVAILABLE = "DRAMA_REVIEW_RESULT_UNAVAILABLE",
7212
+ DRAMA_REVIEW_RESULT_INCONSISTENT = "DRAMA_REVIEW_RESULT_INCONSISTENT",
7213
+ DRAMA_ANCHOR_PLAYBACK_BLOCKED = "DRAMA_ANCHOR_PLAYBACK_BLOCKED",
7214
+ DRAMA_EPISODE_ENFORCED = "DRAMA_EPISODE_ENFORCED",
7215
+ DRAMA_DATABASE_ERROR = "DRAMA_DATABASE_ERROR",
7216
+ DRAMA_SERVER_INTERNAL_ERROR = "DRAMA_SERVER_INTERNAL_ERROR",
7217
+ DRAMA_REVIEW_NOT_PASSED = "DRAMA_REVIEW_NOT_PASSED",
7218
+ DRAMA_CONNECT_TIMEOUT = "DRAMA_CONNECT_TIMEOUT",
7219
+ DRAMA_READ_TIMEOUT = "DRAMA_READ_TIMEOUT",
7220
+ DRAMA_WRITE_TIMEOUT = "DRAMA_WRITE_TIMEOUT",
7221
+ DRAMA_DNS_TIMEOUT = "DRAMA_DNS_TIMEOUT",
7222
+ DRAMA_DNS_FAILURE = "DRAMA_DNS_FAILURE",
7223
+ DRAMA_INTERNET_DISCONNECTED = "DRAMA_INTERNET_DISCONNECTED",
7224
+ DRAMA_NETWORK_CHANGED = "DRAMA_NETWORK_CHANGED",
7225
+ DRAMA_CONNECTION_FAILURE = "DRAMA_CONNECTION_FAILURE",
7226
+ DRAMA_TLS_FAILURE = "DRAMA_TLS_FAILURE",
7227
+ DRAMA_TRANSPORT_EMPTY_RESPONSE = "DRAMA_TRANSPORT_EMPTY_RESPONSE",
7228
+ DRAMA_RESPONSE_INCOMPLETE = "DRAMA_RESPONSE_INCOMPLETE",
7229
+ DRAMA_TRAFFIC_CONTROL_DROP = "DRAMA_TRAFFIC_CONTROL_DROP",
7230
+ DRAMA_NATIVE_ABORTED = "DRAMA_NATIVE_ABORTED",
7231
+ DRAMA_SUCCESS_DATA_MISSING = "DRAMA_SUCCESS_DATA_MISSING",
7157
7232
  DRAMA_FAILED_GET_EPISODE_INFO = "DRAMA_FAILED_GET_EPISODE_INFO"
7158
7233
  }
7159
7234
  declare const DRAMA_ERROR_CODE: {
@@ -7203,135 +7278,222 @@ declare const DRAMA_ERROR_CODE: {
7203
7278
  readonly message: "Video is not on shelf";
7204
7279
  readonly textKey: LangTextKey.DRAMA_NOT_ON_SHELF;
7205
7280
  };
7281
+ readonly EMPTY_PLAYLIST: {
7282
+ readonly code: 9311;
7283
+ readonly message: "Episode video playlist is empty";
7284
+ readonly textKey: LangTextKey.DRAMA_EMPTY_PLAYLIST;
7285
+ };
7286
+ readonly GET_INFO_TIMEOUT: {
7287
+ readonly code: 9312;
7288
+ readonly message: "getDramaInfo request timed out";
7289
+ readonly textKey: LangTextKey.DRAMA_GET_INFO_TIMEOUT;
7290
+ };
7291
+ readonly INVOKE_EXCEPTION: {
7292
+ readonly code: 9313;
7293
+ readonly message: "getDramaInfo invocation failed";
7294
+ readonly textKey: LangTextKey.DRAMA_INVOKE_EXCEPTION;
7295
+ };
7296
+ readonly BRIDGE_FAILURE: {
7297
+ readonly code: 9314;
7298
+ readonly message: "getDramaInfo bridge failed";
7299
+ readonly textKey: LangTextKey.DRAMA_BRIDGE_FAILURE;
7300
+ };
7301
+ readonly NATIVE_TIMEOUT: {
7302
+ readonly code: 9315;
7303
+ readonly message: "Drama request timed out in Native";
7304
+ readonly textKey: LangTextKey.DRAMA_NATIVE_TIMEOUT;
7305
+ };
7306
+ readonly NETWORK_FAILURE: {
7307
+ readonly code: 9316;
7308
+ readonly message: "Drama network request failed";
7309
+ readonly textKey: LangTextKey.DRAMA_NETWORK_FAILURE;
7310
+ };
7311
+ readonly HTTP_FAILURE: {
7312
+ readonly code: 9317;
7313
+ readonly message: "Drama HTTP request failed";
7314
+ readonly textKey: LangTextKey.DRAMA_HTTP_FAILURE;
7315
+ };
7316
+ readonly SERVER_BUSINESS_FAILURE: {
7317
+ readonly code: 9318;
7318
+ readonly message: "Drama service returned a business error";
7319
+ readonly textKey: LangTextKey.DRAMA_SERVER_BUSINESS_FAILURE;
7320
+ };
7321
+ readonly NATIVE_UNKNOWN: {
7322
+ readonly code: 9319;
7323
+ readonly message: "Native drama request failed without a known cause";
7324
+ readonly textKey: LangTextKey.DRAMA_NATIVE_UNKNOWN;
7325
+ };
7326
+ readonly EMPTY_CALLBACK: {
7327
+ readonly code: 9320;
7328
+ readonly message: "getDramaInfo callback result is empty";
7329
+ readonly textKey: LangTextKey.DRAMA_EMPTY_CALLBACK;
7330
+ };
7331
+ readonly INVALID_RESPONSE: {
7332
+ readonly code: 9321;
7333
+ readonly message: "Drama response could not be parsed";
7334
+ readonly textKey: LangTextKey.DRAMA_INVALID_RESPONSE;
7335
+ };
7336
+ readonly INVALID_REVIEW_STATUS: {
7337
+ readonly code: 9322;
7338
+ readonly message: "Drama review status is invalid";
7339
+ readonly textKey: LangTextKey.DRAMA_INVALID_REVIEW_STATUS;
7340
+ };
7341
+ readonly INVALID_VIDEO_INFO: {
7342
+ readonly code: 9323;
7343
+ readonly message: "Drama video info has an invalid type";
7344
+ readonly textKey: LangTextKey.DRAMA_INVALID_VIDEO_INFO;
7345
+ };
7346
+ readonly MISSING_PLAYLIST: {
7347
+ readonly code: 9324;
7348
+ readonly message: "Drama playlist field is missing";
7349
+ readonly textKey: LangTextKey.DRAMA_MISSING_PLAYLIST;
7350
+ };
7351
+ readonly INVALID_PLAYLIST: {
7352
+ readonly code: 9325;
7353
+ readonly message: "Drama playlist has an invalid type";
7354
+ readonly textKey: LangTextKey.DRAMA_INVALID_PLAYLIST;
7355
+ };
7356
+ readonly INVALID_PLAY_ITEMS: {
7357
+ readonly code: 9326;
7358
+ readonly message: "Drama playlist contains no valid items";
7359
+ readonly textKey: LangTextKey.DRAMA_INVALID_PLAY_ITEMS;
7360
+ };
7361
+ readonly UNUSABLE_PLAY_URLS: {
7362
+ readonly code: 9327;
7363
+ readonly message: "Drama playlist contains no usable playback URL";
7364
+ readonly textKey: LangTextKey.DRAMA_UNUSABLE_PLAY_URLS;
7365
+ };
7366
+ readonly NORMALIZED_PLAYLIST_EMPTY: {
7367
+ readonly code: 9328;
7368
+ readonly message: "Normalized drama playlist is empty";
7369
+ readonly textKey: LangTextKey.DRAMA_NORMALIZED_PLAYLIST_EMPTY;
7370
+ };
7371
+ readonly TRANSFORM_EXCEPTION: {
7372
+ readonly code: 9329;
7373
+ readonly message: "Drama video info conversion failed";
7374
+ readonly textKey: LangTextKey.DRAMA_TRANSFORM_EXCEPTION;
7375
+ };
7376
+ readonly ALBUM_ACCESS_DENIED: {
7377
+ readonly code: 9330;
7378
+ readonly message: "Drama album access denied";
7379
+ readonly textKey: LangTextKey.DRAMA_ALBUM_ACCESS_DENIED;
7380
+ };
7381
+ readonly ALBUM_NOT_FOUND: {
7382
+ readonly code: 9331;
7383
+ readonly message: "Drama album not found";
7384
+ readonly textKey: LangTextKey.DRAMA_ALBUM_NOT_FOUND;
7385
+ };
7386
+ readonly REVIEW_RESULT_UNAVAILABLE: {
7387
+ readonly code: 9332;
7388
+ readonly message: "Drama review result is unavailable";
7389
+ readonly textKey: LangTextKey.DRAMA_REVIEW_RESULT_UNAVAILABLE;
7390
+ };
7391
+ readonly REVIEW_RESULT_INCONSISTENT: {
7392
+ readonly code: 9333;
7393
+ readonly message: "Drama review result is inconsistent";
7394
+ readonly textKey: LangTextKey.DRAMA_REVIEW_RESULT_INCONSISTENT;
7395
+ };
7396
+ readonly ANCHOR_PLAYBACK_BLOCKED: {
7397
+ readonly code: 9334;
7398
+ readonly message: "Drama anchor playback is blocked";
7399
+ readonly textKey: LangTextKey.DRAMA_ANCHOR_PLAYBACK_BLOCKED;
7400
+ };
7401
+ readonly EPISODE_ENFORCED: {
7402
+ readonly code: 9335;
7403
+ readonly message: "Drama episode was taken down";
7404
+ readonly textKey: LangTextKey.DRAMA_EPISODE_ENFORCED;
7405
+ };
7406
+ readonly DATABASE_ERROR: {
7407
+ readonly code: 9336;
7408
+ readonly message: "Drama service database operation failed";
7409
+ readonly textKey: LangTextKey.DRAMA_DATABASE_ERROR;
7410
+ };
7411
+ readonly SERVER_INTERNAL_ERROR: {
7412
+ readonly code: 9337;
7413
+ readonly message: "Drama service internal error";
7414
+ readonly textKey: LangTextKey.DRAMA_SERVER_INTERNAL_ERROR;
7415
+ };
7416
+ readonly REVIEW_NOT_PASSED: {
7417
+ readonly code: 9338;
7418
+ readonly message: "Drama episode has not passed review";
7419
+ readonly textKey: LangTextKey.DRAMA_REVIEW_NOT_PASSED;
7420
+ };
7421
+ readonly CONNECT_TIMEOUT: {
7422
+ readonly code: 9340;
7423
+ readonly message: "Drama connection timed out";
7424
+ readonly textKey: LangTextKey.DRAMA_CONNECT_TIMEOUT;
7425
+ };
7426
+ readonly READ_TIMEOUT: {
7427
+ readonly code: 9341;
7428
+ readonly message: "Drama response read timed out";
7429
+ readonly textKey: LangTextKey.DRAMA_READ_TIMEOUT;
7430
+ };
7431
+ readonly WRITE_TIMEOUT: {
7432
+ readonly code: 9342;
7433
+ readonly message: "Drama request write timed out";
7434
+ readonly textKey: LangTextKey.DRAMA_WRITE_TIMEOUT;
7435
+ };
7436
+ readonly DNS_TIMEOUT: {
7437
+ readonly code: 9343;
7438
+ readonly message: "Drama DNS lookup timed out";
7439
+ readonly textKey: LangTextKey.DRAMA_DNS_TIMEOUT;
7440
+ };
7441
+ readonly DNS_FAILURE: {
7442
+ readonly code: 9344;
7443
+ readonly message: "Drama DNS lookup failed";
7444
+ readonly textKey: LangTextKey.DRAMA_DNS_FAILURE;
7445
+ };
7446
+ readonly INTERNET_DISCONNECTED: {
7447
+ readonly code: 9345;
7448
+ readonly message: "Drama request failed while disconnected";
7449
+ readonly textKey: LangTextKey.DRAMA_INTERNET_DISCONNECTED;
7450
+ };
7451
+ readonly NETWORK_CHANGED: {
7452
+ readonly code: 9346;
7453
+ readonly message: "Network changed during drama request";
7454
+ readonly textKey: LangTextKey.DRAMA_NETWORK_CHANGED;
7455
+ };
7456
+ readonly CONNECTION_FAILURE: {
7457
+ readonly code: 9347;
7458
+ readonly message: "Drama network connection failed";
7459
+ readonly textKey: LangTextKey.DRAMA_CONNECTION_FAILURE;
7460
+ };
7461
+ readonly TLS_FAILURE: {
7462
+ readonly code: 9348;
7463
+ readonly message: "Drama secure connection failed";
7464
+ readonly textKey: LangTextKey.DRAMA_TLS_FAILURE;
7465
+ };
7466
+ readonly TRANSPORT_EMPTY_RESPONSE: {
7467
+ readonly code: 9349;
7468
+ readonly message: "Drama transport received no response data";
7469
+ readonly textKey: LangTextKey.DRAMA_TRANSPORT_EMPTY_RESPONSE;
7470
+ };
7471
+ readonly RESPONSE_INCOMPLETE: {
7472
+ readonly code: 9350;
7473
+ readonly message: "Drama network response is incomplete";
7474
+ readonly textKey: LangTextKey.DRAMA_RESPONSE_INCOMPLETE;
7475
+ };
7476
+ readonly TRAFFIC_CONTROL_DROP: {
7477
+ readonly code: 9351;
7478
+ readonly message: "Drama request dropped by traffic control";
7479
+ readonly textKey: LangTextKey.DRAMA_TRAFFIC_CONTROL_DROP;
7480
+ };
7481
+ readonly NATIVE_ABORTED: {
7482
+ readonly code: 9352;
7483
+ readonly message: "Drama request aborted by Native";
7484
+ readonly textKey: LangTextKey.DRAMA_NATIVE_ABORTED;
7485
+ };
7486
+ readonly SUCCESS_DATA_MISSING: {
7487
+ readonly code: 9353;
7488
+ readonly message: "Drama response declared success but has no data";
7489
+ readonly textKey: LangTextKey.DRAMA_SUCCESS_DATA_MISSING;
7490
+ };
7206
7491
  readonly FAILED_GET_EPISODE_INFO: {
7207
7492
  readonly code: 9399;
7208
7493
  readonly message: "Failed get episode info";
7209
7494
  readonly textKey: LangTextKey.DRAMA_FAILED_GET_EPISODE_INFO;
7210
7495
  };
7211
7496
  };
7212
- declare class AuthToken extends SdkPlugin {
7213
- static get pluginName(): string;
7214
- isPlayByToken: boolean;
7215
- isEncrypt: boolean;
7216
- tokenInfo: ITokenInfo;
7217
- keyTokenInfo: ITokenInfo;
7218
- thirdPartyDrmAuthTokenInfo: ITokenInfo;
7219
- config: IPlayAuthTokenConfig;
7220
- privateDrmAuthToken: string;
7221
- useUnionInfoDRM: boolean;
7222
- sessionId: string;
7223
- retryCount: number;
7224
- playInfo?: VideoInfoRes;
7225
- constructor(args: any);
7226
- beforePlayerCreate(): Promise<void>;
7227
- getVideoInfo(sourceConfigs?: IPlayerConfig): Promise<{
7228
- vid: string;
7229
- __mediaInfoCacheHit: boolean;
7230
- playList: Stream[];
7231
- codec: ICodecType;
7232
- defaultDefinition: string;
7233
- }>;
7234
- /**
7235
- * 短剧 Minis 环境:通过 JSB getDramaInfo 获取媒体信息
7236
- */
7237
- getDramaInfoViaJSB(sourceConfigs?: IPlayerConfig): Promise<VideoInfoRes | undefined>;
7238
- /**
7239
- * 将审核状态映射到短剧错误码
7240
- */
7241
- mapReviewStatusToErrorCode(status: number): keyof typeof DRAMA_ERROR_CODE;
7242
- /**
7243
- * 根据 JSB 返回的 msg 或 status 映射到错误码 key
7244
- */
7245
- mapDramaErrorCode(msg: string, status?: number): keyof typeof DRAMA_ERROR_CODE;
7246
- /**
7247
- * 将 JSB 返回的 video_info 转换为 VideoInfoRes 格式
7248
- */
7249
- transformDramaVideoInfoToRes(videoInfo: any, config: IPlayAuthTokenConfig): VideoInfoRes;
7250
- callOnGetMediaInfo(mediaInfo: VideoInfoRes | undefined, fromCache: boolean): void;
7251
- reportGetDramaInfoPerf(res: IJSBCallbackResult | undefined, request: {
7252
- albumId?: string;
7253
- episodeId?: string;
7254
- vid?: string;
7255
- }): void;
7256
- getVideos(sourceConfigs?: IPlayerConfig): Promise<any>;
7257
- getPrivateDrmInfo(playList: Stream[], vid: string, streamType: string): Promise<void>;
7258
- getThumbnailConfig(thumbs: IThumbInfoItem[]): void;
7259
- getBarrageMaskUrl(url: string): void;
7260
- setSubtitleConfig(mediaInfo: VideoInfoRes | undefined): void;
7261
- getAutoSubtitleList(mediaInfo: VideoInfoRes): ISubTitleItem[];
7262
- getSubtitleSourceData(mediaInfo: VideoInfoRes): any;
7263
- getAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
7264
- getStringAutoSubtitleItem(item: string, index: number): ISubTitleItem;
7265
- getObjectAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
7266
- formatAutoSubtitleItem(subtitleItem: ISubTitleItem, rawItem: any, index: number): ISubTitleItem | undefined;
7267
- getDrmConfig(videoInfo: IVideoInfo): void;
7268
- /**
7269
- * 是否处于短剧 Minis 环境(通过剧 ID + 剧集 ID 获取视频)
7270
- */
7271
- get isMinisDramaMode(): boolean;
7272
- init(): void;
7273
- initConfig(getVideoByToken: IPlayAuthTokenConfig, sourceConfigs?: IPlayerConfig): void;
7274
- /**
7275
- * 剧集切换:configs 已由 player 更新 album_id/episode_id,重新拉取媒体信息
7276
- */
7277
- updateDramaEpisode(isNewVideo: boolean, candidateConfig?: IPlayerConfig): Promise<void>;
7278
- /**
7279
- * @description 更新playAuthToken
7280
- * @param {IPlayAuthTokenConfig} getVideoByToken token信息
7281
- * @param {boolean} isNewVideo 是否新视频,即是否为切换视频
7282
- */
7283
- updateAuthToken(getVideoByToken: IPlayAuthTokenConfig, isNewVideo: boolean): Promise<void>;
7284
- checkPlayAuthTokenValid(): boolean;
7285
- checkKeyTokenValid(): boolean;
7286
- checkDrmAuthTokenValid(): boolean;
7287
- }
7288
- /** {zh}
7289
- * @hidden
7290
- */
7291
- /** {en}
7292
- * @hidden
7293
- */
7294
- export interface IAdaptRangeDefaultOptions {
7295
- maxTargetCacheDur: number;
7296
- minTargetCacheDur: number;
7297
- rangeMaxDuration: number;
7298
- rangeMinDuration: number;
7299
- cacheSafeFactor: number;
7300
- estPTcontrol: boolean;
7301
- estPlayTime: number;
7302
- minBandwidth: number;
7303
- minDangerThreshold: number;
7304
- rangeControl: boolean;
7305
- rangeMinSize: number;
7306
- safeFactor: number;
7307
- targetCacheControl: boolean;
7308
- }
7309
- declare abstract class AbstractBaseAdapter {
7310
- isLive: boolean;
7311
- playerData: PlayerData;
7312
- streamType: string;
7313
- constructor(options: {
7314
- configs: IPlayerConfig;
7315
- playerData: PlayerData;
7316
- streamType: string;
7317
- });
7318
- /**
7319
- * @description 是否使用原生video的abr能力
7320
- */
7321
- abstract useNativeAbr(): boolean;
7322
- abstract canOpenAbr(vidPlayInfo?: VideoInfoRes): boolean;
7323
- abstract applyAbrPluginConfig(_finalOptions: any, _autoBitrateOpts: any): void;
7324
- abstract prepareAbrModule(_playerData: any, _sdkUmdLoader: any): void;
7325
- abstract needAbrAutoDefinition(): boolean;
7326
- abstract setAbrDefaultDefiWithAuto(): boolean;
7327
- abstract generatePlaylistFromServer(res: VideoInfoRes, ...args: any[]): Stream[];
7328
- abstract canAdaptRangeEnable(): boolean;
7329
- abstract adaptRangeDefaultOptions(): IAdaptRangeDefaultOptions | undefined;
7330
- abstract applyAdaptRangePluginConfig(_finalOptions: any, _adaptRangeOptions: any): void;
7331
- abstract applyAdaptRangeStrategy(_finalOptions: any, _adaptRangeOptions: any): void;
7332
- abstract getPlugins(umdLoader: UMDLoader): Promise<XGPlugin[]>;
7333
- abstract setPluginConfigInVid(videoInfo: IVideoInfo, context: AuthToken): void;
7334
- }
7335
7497
  /** {zh}
7336
7498
  * @list Options
7337
7499
  * @brief 字幕项。
@@ -7564,6 +7726,162 @@ export interface ITextItem {
7564
7726
  */
7565
7727
  export type HlsAbrEngine = "hlsjs" | "veplayer";
7566
7728
  export type TLogChannel = "cn" | "va" | "sg";
7729
+ /**
7730
+ * JSB getDramaInfo 返回的客户端耗时信息,单位 ms。
7731
+ */
7732
+ export interface IGetDramaInfoPerfInfo {
7733
+ prepare_cost?: number;
7734
+ request_cost?: number;
7735
+ parse_cost?: number;
7736
+ total_cost?: number;
7737
+ [propName: string]: any;
7738
+ }
7739
+ /** {zh} @brief 仅包含可安全上报的剧集请求诊断。 @hidden */
7740
+ /** {en} @brief Safe, bounded drama request diagnostics. @hidden */
7741
+ export interface DramaDiagnostics {
7742
+ version: 1;
7743
+ code?: number;
7744
+ source?: string;
7745
+ stage?: string;
7746
+ reason?: string;
7747
+ logid?: string;
7748
+ logid_source?: string;
7749
+ perf_info?: IGetDramaInfoPerfInfo;
7750
+ attempts?: DramaDiagnostics[];
7751
+ [key: string]: any;
7752
+ }
7753
+ declare class AuthToken extends SdkPlugin {
7754
+ static get pluginName(): string;
7755
+ isPlayByToken: boolean;
7756
+ isEncrypt: boolean;
7757
+ tokenInfo: ITokenInfo;
7758
+ keyTokenInfo: ITokenInfo;
7759
+ thirdPartyDrmAuthTokenInfo: ITokenInfo;
7760
+ config: IPlayAuthTokenConfig;
7761
+ privateDrmAuthToken: string;
7762
+ useUnionInfoDRM: boolean;
7763
+ sessionId: string;
7764
+ retryCount: number;
7765
+ playInfo?: VideoInfoRes;
7766
+ private dramaRequestControllers;
7767
+ /** {zh} @brief 取消生命周期失效的剧集请求,不产生播放失败。 @hidden */
7768
+ /** {en} @brief Cancel superseded drama requests without reporting playback failure. @hidden */
7769
+ cancelDramaRequests(): void;
7770
+ destroy(): void;
7771
+ constructor(args: any);
7772
+ beforePlayerCreate(): Promise<void>;
7773
+ getVideoInfo(sourceConfigs?: IPlayerConfig, errors?: any[]): Promise<{
7774
+ vid: string;
7775
+ __mediaInfoCacheHit: boolean;
7776
+ __serverFetchDuration: number;
7777
+ __dramaTrackingContext: Record<string, unknown>;
7778
+ __dramaDiagnostics: DramaDiagnostics;
7779
+ playList: Stream[];
7780
+ codec: ICodecType;
7781
+ defaultDefinition: string;
7782
+ }>;
7783
+ private reportEmptyDramaPlaylist;
7784
+ /**
7785
+ * 短剧 Minis 环境:通过 JSB getDramaInfo 获取媒体信息
7786
+ */
7787
+ getDramaInfoViaJSB(sourceConfigs?: IPlayerConfig, errors?: any[]): Promise<VideoInfoRes | undefined>;
7788
+ /**
7789
+ * 将审核状态映射到短剧错误码
7790
+ */
7791
+ mapReviewStatusToErrorCode(status: number): keyof typeof DRAMA_ERROR_CODE;
7792
+ /**
7793
+ * 根据 JSB 返回的 msg 或 status 映射到错误码 key
7794
+ */
7795
+ mapDramaErrorCode(msg: string, status?: number): keyof typeof DRAMA_ERROR_CODE;
7796
+ /**
7797
+ * 将 JSB 返回的 video_info 转换为 VideoInfoRes 格式
7798
+ */
7799
+ transformDramaVideoInfoToRes(videoInfo: any, config: IPlayAuthTokenConfig): VideoInfoRes;
7800
+ callOnGetMediaInfo(mediaInfo: VideoInfoRes | undefined, fromCache: boolean): void;
7801
+ reportGetDramaInfoPerf(res: IJSBCallbackResult | undefined, request: {
7802
+ albumId?: string;
7803
+ episodeId?: string;
7804
+ vid?: string;
7805
+ }): void;
7806
+ getVideos(sourceConfigs?: IPlayerConfig, errors?: any[]): Promise<any>;
7807
+ getPrivateDrmInfo(playList: Stream[], vid: string, streamType: string): Promise<void>;
7808
+ getThumbnailConfig(thumbs: IThumbInfoItem[]): void;
7809
+ getBarrageMaskUrl(url: string): void;
7810
+ setSubtitleConfig(mediaInfo: VideoInfoRes | undefined): void;
7811
+ getAutoSubtitleList(mediaInfo: VideoInfoRes): ISubTitleItem[];
7812
+ getSubtitleSourceData(mediaInfo: VideoInfoRes): any;
7813
+ getAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
7814
+ getStringAutoSubtitleItem(item: string, index: number): ISubTitleItem;
7815
+ getObjectAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
7816
+ formatAutoSubtitleItem(subtitleItem: ISubTitleItem, rawItem: any, index: number): ISubTitleItem | undefined;
7817
+ getDrmConfig(videoInfo: IVideoInfo): void;
7818
+ /**
7819
+ * 是否处于短剧 Minis 环境(通过剧 ID + 剧集 ID 获取视频)
7820
+ */
7821
+ get isMinisDramaMode(): boolean;
7822
+ init(): void;
7823
+ initConfig(getVideoByToken: IPlayAuthTokenConfig, sourceConfigs?: IPlayerConfig): void;
7824
+ /**
7825
+ * 剧集切换:configs 已由 player 更新 album_id/episode_id,重新拉取媒体信息
7826
+ */
7827
+ updateDramaEpisode(isNewVideo: boolean, candidateConfig?: IPlayerConfig, errors?: any[]): Promise<void>;
7828
+ /**
7829
+ * @description 更新playAuthToken
7830
+ * @param {IPlayAuthTokenConfig} getVideoByToken token信息
7831
+ * @param {boolean} isNewVideo 是否新视频,即是否为切换视频
7832
+ */
7833
+ updateAuthToken(getVideoByToken: IPlayAuthTokenConfig, isNewVideo: boolean): Promise<void>;
7834
+ checkPlayAuthTokenValid(errors?: any[]): boolean;
7835
+ checkKeyTokenValid(errors?: any[]): boolean;
7836
+ checkDrmAuthTokenValid(errors?: any[]): boolean;
7837
+ }
7838
+ /** {zh}
7839
+ * @hidden
7840
+ */
7841
+ /** {en}
7842
+ * @hidden
7843
+ */
7844
+ export interface IAdaptRangeDefaultOptions {
7845
+ maxTargetCacheDur: number;
7846
+ minTargetCacheDur: number;
7847
+ rangeMaxDuration: number;
7848
+ rangeMinDuration: number;
7849
+ cacheSafeFactor: number;
7850
+ estPTcontrol: boolean;
7851
+ estPlayTime: number;
7852
+ minBandwidth: number;
7853
+ minDangerThreshold: number;
7854
+ rangeControl: boolean;
7855
+ rangeMinSize: number;
7856
+ safeFactor: number;
7857
+ targetCacheControl: boolean;
7858
+ }
7859
+ declare abstract class AbstractBaseAdapter {
7860
+ isLive: boolean;
7861
+ playerData: PlayerData;
7862
+ streamType: string;
7863
+ constructor(options: {
7864
+ configs: IPlayerConfig;
7865
+ playerData: PlayerData;
7866
+ streamType: string;
7867
+ });
7868
+ /**
7869
+ * @description 是否使用原生video的abr能力
7870
+ */
7871
+ abstract useNativeAbr(): boolean;
7872
+ abstract canOpenAbr(vidPlayInfo?: VideoInfoRes): boolean;
7873
+ abstract applyAbrPluginConfig(_finalOptions: any, _autoBitrateOpts: any): void;
7874
+ abstract prepareAbrModule(_playerData: any, _sdkUmdLoader: any): void;
7875
+ abstract needAbrAutoDefinition(): boolean;
7876
+ abstract setAbrDefaultDefiWithAuto(): boolean;
7877
+ abstract generatePlaylistFromServer(res: VideoInfoRes, ...args: any[]): Stream[];
7878
+ abstract canAdaptRangeEnable(): boolean;
7879
+ abstract adaptRangeDefaultOptions(): IAdaptRangeDefaultOptions | undefined;
7880
+ abstract applyAdaptRangePluginConfig(_finalOptions: any, _adaptRangeOptions: any): void;
7881
+ abstract applyAdaptRangeStrategy(_finalOptions: any, _adaptRangeOptions: any): void;
7882
+ abstract getPlugins(umdLoader: UMDLoader): Promise<XGPlugin[]>;
7883
+ abstract setPluginConfigInVid(videoInfo: IVideoInfo, context: AuthToken): void;
7884
+ }
7567
7885
  declare class PlayerData {
7568
7886
  id?: string;
7569
7887
  root?: HTMLElement;
@@ -7663,7 +7981,7 @@ declare class PlayerData {
7663
7981
  /**
7664
7982
  * @description: 获取当前的streamType
7665
7983
  */
7666
- getCurrentStreamType(): string;
7984
+ getCurrentStreamType(fallback?: string): string;
7667
7985
  getStreamType(): string;
7668
7986
  getConfiguredHlsAbrEngine(): HlsAbrEngine;
7669
7987
  isOpenVePlayerABR(): boolean;
@@ -7903,6 +8221,20 @@ export declare type IPreloadUpdateConfig = {
7903
8221
  * @detail Options
7904
8222
  */
7905
8223
  export declare type IPreloadResolvedStream = {
8224
+ /** {zh}
8225
+ * @brief HLS 分片数量,覆盖 strategies.preload.sn。
8226
+ */
8227
+ /** {en}
8228
+ * @brief HLS segment count; overrides strategies.preload.sn.
8229
+ */
8230
+ sn?: number;
8231
+ /** {zh}
8232
+ * @brief HLS master 子列表索引,覆盖 strategies.preload.level。
8233
+ */
8234
+ /** {en}
8235
+ * @brief Zero-based HLS master variant index; overrides strategies.preload.level.
8236
+ */
8237
+ level?: number;
7906
8238
  /** {zh}
7907
8239
  * @brief 视频 ID
7908
8240
  */
@@ -8028,6 +8360,9 @@ export declare type IMediaInfoPrefetchFailure = {
8028
8360
  error: {
8029
8361
  code: number;
8030
8362
  message: string;
8363
+ /** {zh} @brief 获取剧集信息失败的安全诊断。 */
8364
+ /** {en} @brief Safe diagnostics for a failed drama info request. */
8365
+ diagnostics?: DramaDiagnostics;
8031
8366
  };
8032
8367
  };
8033
8368
  /** {zh}
@@ -8040,6 +8375,13 @@ export declare type IMediaInfoPrefetchFailure = {
8040
8375
  */
8041
8376
  export declare type IMediaInfoPrefetchResult = IMediaInfoPrefetchSuccess | IMediaInfoPrefetchFailure;
8042
8377
  export declare type IPreloadStream = IPreloadResolvedStream | IPreloadDramaStream | IPreloadAuthTokenStream;
8378
+ export declare type KernelWarmupOptions = {
8379
+ /** Independent kill switch. V1 also requires explicit preload configuration. */
8380
+ enabled?: boolean;
8381
+ timeoutMs?: number;
8382
+ maxAgeMs?: number;
8383
+ minBufferSeconds?: number;
8384
+ };
8043
8385
  /** {zh}
8044
8386
  * @hidden
8045
8387
  * h265策略配置
@@ -8089,16 +8431,30 @@ export declare type IPreloadConfig = {
8089
8431
  */
8090
8432
  preloadScene?: PreloadScene;
8091
8433
  /** {zh}
8092
- * @brief 视频格式
8434
+ * @brief 预加载格式,可传数组以同时初始化 MP4 和 HLS。
8093
8435
  * - mp4: mp4格式
8094
8436
  * - hls: hls格式
8095
8437
  * @default mp4
8096
8438
  */
8097
8439
  /** {en}
8098
- * @brief Video format.
8440
+ * @brief Preload format. An array initializes both MP4 and HLS.
8099
8441
  * @default mp4
8100
8442
  */
8101
- format?: PreloadFormat;
8443
+ format?: PreloadFormat | PreloadFormat[];
8444
+ /** {zh}
8445
+ * @brief HLS 预载分片数量,正整数,默认 2。
8446
+ */
8447
+ /** {en}
8448
+ * @brief Number of HLS segments to preload. Positive integer; defaults to 2.
8449
+ */
8450
+ sn?: number;
8451
+ /** {zh}
8452
+ * @brief HLS master 子列表索引,从 0 开始,默认 0。
8453
+ */
8454
+ /** {en}
8455
+ * @brief Zero-based HLS master variant index; defaults to 0.
8456
+ */
8457
+ level?: number;
8102
8458
  /** {zh}
8103
8459
  * 向前预加载视频个数,Feed流场景时生效
8104
8460
  * @default 1
@@ -8221,6 +8577,8 @@ export declare type StrategyConfigOptions = {
8221
8577
  * @detail Options
8222
8578
  */
8223
8579
  export declare type StrategyInitOptions = {
8580
+ /** HLS kernel warmup. V1 requires explicit preload + setPreloadList; enabled by default under those gates. */
8581
+ kernelWarmup?: KernelWarmupOptions;
8224
8582
  /** {zh}
8225
8583
  * 应用ID
8226
8584
  * @brief 应用 ID
@@ -8411,6 +8769,7 @@ export interface PlayerPlaybackStateSnapshot extends DramaIdentity {
8411
8769
  export interface IdentitySwitchTransaction {
8412
8770
  readonly settled: Promise<void>;
8413
8771
  }
8772
+ declare const STANDBY_SLOT: unique symbol;
8414
8773
  /** {zh}
8415
8774
  * @hidden
8416
8775
  */
@@ -8463,6 +8822,16 @@ export interface EncryptInfo {
8463
8822
  unionInfo: string;
8464
8823
  }
8465
8824
  declare class VePlayer {
8825
+ private _standby;
8826
+ private _standbyInit?;
8827
+ private _warmup?;
8828
+ private _warmupVisibility?;
8829
+ private _warmupHandoff;
8830
+ private _mediaExpiredListener?;
8831
+ /** @hidden Internal preparation mode; never registered as current playback. */
8832
+ get isWarmupStandby(): boolean;
8833
+ /** @hidden Diagnostic only, not a first-frame metric. */
8834
+ getKernelWarmupState(): string;
8466
8835
  /** {zh}
8467
8836
  * @brief 供 JSSDK 门面查询当前播放器播放状态。
8468
8837
  * @hidden
@@ -8730,6 +9099,23 @@ declare class VePlayer {
8730
9099
  * ```
8731
9100
  */
8732
9101
  static prefetchMediaInfo(sources: IMediaInfoPrefetchSource[]): Promise<IMediaInfoPrefetchResult[]>;
9102
+ /** {zh}
9103
+ * @brief 全局设置是否为 MSE 媒体请求添加 x-tt-trace-id,默认关闭。
9104
+ * @param enable - 是否开启。新建播放器或下一次 playNext 时生效,当前播放保持原设置。
9105
+ * @notes 开启前需确保 CDN 的 CORS 配置允许 x-tt-trace-id。独立预加载不添加该请求头。
9106
+ * @example
9107
+ * VePlayer.setMediaTraceEnabled(true);
9108
+ * @list Api
9109
+ */
9110
+ /** {en}
9111
+ * @brief Globally enable x-tt-trace-id on MSE media requests. Disabled by default.
9112
+ * @param enable - Applies to new players and the next playNext; the current playback is unchanged.
9113
+ * @notes The CDN must allow x-tt-trace-id in CORS. Independent preloads do not include this header.
9114
+ * @example
9115
+ * VePlayer.setMediaTraceEnabled(true);
9116
+ * @list Api
9117
+ */
9118
+ static setMediaTraceEnabled(enable: boolean): void;
8733
9119
  /** {zh}
8734
9120
  * @brief 设置全局日志开关。开启后会输出 VE_DEBUG.log 级别日志。
8735
9121
  * @param enable 是否开启详细日志
@@ -8837,6 +9223,7 @@ declare class VePlayer {
8837
9223
  */
8838
9224
  static generateEncryptInfo(unionId: string, streamType: "hls" | "mp4" | "dash"): Promise<EncryptInfo | undefined>;
8839
9225
  private static hasInitVeStrategy;
9226
+ private static warmupPrepareGeneration;
8840
9227
  /**
8841
9228
  * @hidden
8842
9229
  * 延时触发的events,即保证在player创建之后才触发
@@ -8858,7 +9245,7 @@ declare class VePlayer {
8858
9245
  /** {en}
8859
9246
  * @brief Constructor.
8860
9247
  */
8861
- constructor(configs: IPlayerConfig);
9248
+ constructor(configs: IPlayerConfig, internalMode?: typeof STANDBY_SLOT);
8862
9249
  /** @hidden */
8863
9250
  assertLiteConfig(config?: Partial<IPlayerConfig>): void;
8864
9251
  /**
@@ -9287,6 +9674,7 @@ declare class VePlayer {
9287
9674
  * @memberof VePlayer
9288
9675
  */
9289
9676
  updateAuthToken(config: IPlayAuthTokenConfig): Promise<void>;
9677
+ private _finishMediaPreparation;
9290
9678
  private _playerPlayNext;
9291
9679
  /** {zh}
9292
9680
  * @brief 返回当前视频的地址。
@@ -9358,6 +9746,12 @@ declare class VePlayer {
9358
9746
  private _cancelStalePlayerCreation;
9359
9747
  private _discardStalePlayer;
9360
9748
  private updatePlayNextSubtitleConfig;
9749
+ private _warmupFingerprint;
9750
+ private _bindWarmupScheduling;
9751
+ private _prepareWarmupSlot;
9752
+ private _playNextWithWarmup;
9753
+ private _activateWarmupSlot;
9754
+ private _waitForWarmupFallback;
9361
9755
  private _playNext;
9362
9756
  private _applyIncomingIdentityAliases;
9363
9757
  private _createDramaPlayNextCandidateConfig;
@@ -9366,6 +9760,7 @@ declare class VePlayer {
9366
9760
  private _buildDramaInvalidParamError;
9367
9761
  private _getDramaAlbumIdFromConfig;
9368
9762
  private _getDramaEpisodeIdFromConfig;
9763
+ private _reportPlayNextFailure;
9369
9764
  private switchDramaEpisode;
9370
9765
  /** {zh}
9371
9766
  * @brief 销毁xgplayer实例