@volcengine/veplayer 1.20.0-rc.1 → 1.20.0-rc.11

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
  /**
@@ -3385,6 +3394,19 @@ export interface ITTDramaEnv {
3385
3394
  * @type {function}
3386
3395
  */
3387
3396
  sendLog: (EventName: string, params: Record<string, any>) => void;
3397
+ /** {zh}
3398
+ * @hidden
3399
+ * @brief 当前在播短剧身份变化通知,由宿主集成层消费。
3400
+ */
3401
+ /** {en}
3402
+ * @hidden
3403
+ * @brief Notifies the host integration when the current drama playback identity changes.
3404
+ */
3405
+ onCurrentDramaPlaybackContextChange?: (context: {
3406
+ albumId: string | null;
3407
+ episodeId: string | null;
3408
+ vid: string | null;
3409
+ } | null) => boolean | void;
3388
3410
  /**
3389
3411
  * 低版本 app 下验证 TTOP 签发的 playAuthToken 时使用的密钥
3390
3412
  * 通过 JSB(如 minis.getSecret)从 Native 获取,用于 HMAC-SHA256 签名校验
@@ -3433,18 +3455,41 @@ export interface IGetDramaInfoPerfInfo {
3433
3455
  * JSB 获取短剧信息返回结果
3434
3456
  */
3435
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
+ };
3436
3472
  is_success: number | boolean;
3437
3473
  error?: MinisError;
3438
3474
  data?: {
3475
+ /** {zh} @brief Native 埋点通参;缺失时不报对应字段。 */
3476
+ /** {en} @brief Native tracking fields; omitted fields are not reported. */
3477
+ tracking_context?: IJSBCallbackResult["tracking_context"];
3439
3478
  status: number;
3440
3479
  drama_info: {
3441
- album_id: string;
3442
- drama_name: string;
3443
- drama_cover: string;
3444
- 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;
3445
3489
  };
3446
3490
  episode_info: {
3447
3491
  episode_id: string;
3492
+ episode_current_num?: number;
3448
3493
  episode_name: string;
3449
3494
  episode_cover: string;
3450
3495
  episode_description: string;
@@ -4735,19 +4780,19 @@ export interface IPlayerConfig extends IPlayerOptions {
4735
4780
  /** {zh}
4736
4781
  * @brief 起播和 playNext 的 getDramaInfo JSB 超时与重试配置。
4737
4782
  * @list Options
4738
- * @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 为非负数;无效值回退默认值。
4739
4784
  * @example
4740
4785
  * ```javascript
4741
- * new VePlayer({ dramaInfoRequest: { timeout: 3000, retryCount: 3, retryInterval: 1000 } });
4786
+ * new VePlayer({ dramaInfoRequest: { timeout: 10000, retryCount: 3, retryInterval: 1000 } });
4742
4787
  * ```
4743
4788
  */
4744
4789
  /** {en}
4745
4790
  * @brief Configure getDramaInfo JSB timeouts and retries for startup and playNext.
4746
4791
  * @list Options
4747
- * @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.
4748
4793
  * @example
4749
4794
  * ```javascript
4750
- * new VePlayer({ dramaInfoRequest: { timeout: 3000, retryCount: 3, retryInterval: 1000 } });
4795
+ * new VePlayer({ dramaInfoRequest: { timeout: 10000, retryCount: 3, retryInterval: 1000 } });
4751
4796
  * ```
4752
4797
  */
4753
4798
  dramaInfoRequest?: {
@@ -7089,6 +7134,7 @@ export declare const enum LangTextKey {
7089
7134
  NETWORK_URL_EXPIRE = "NETWORK_URL_EXPIRE",
7090
7135
  NETWORK_URL_SIGN = "NETWORK_URL_SIGN",
7091
7136
  NETWORK_ENCRYPT_HLS_ERR = "NETWORK_ENCRYPT_HLS_ERR",
7137
+ DECODER_INIT_NOT_SUPPORTED = "DECODER_INIT_NOT_SUPPORTED",
7092
7138
  MEDIA_ERR = "MEDIA_ERR",
7093
7139
  MEDIA_ERR_ABORTED = "MEDIA_ERR_ABORTED",
7094
7140
  MEDIA_ERR_NETWORK = "MEDIA_ERR_NETWORK",
@@ -7141,6 +7187,48 @@ export declare const enum LangTextKey {
7141
7187
  DRAMA_FAILED_TO_QUERY = "DRAMA_FAILED_TO_QUERY",
7142
7188
  DRAMA_INVALID_TTOP_TOKEN = "DRAMA_INVALID_TTOP_TOKEN",
7143
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",
7144
7232
  DRAMA_FAILED_GET_EPISODE_INFO = "DRAMA_FAILED_GET_EPISODE_INFO"
7145
7233
  }
7146
7234
  declare const DRAMA_ERROR_CODE: {
@@ -7190,135 +7278,222 @@ declare const DRAMA_ERROR_CODE: {
7190
7278
  readonly message: "Video is not on shelf";
7191
7279
  readonly textKey: LangTextKey.DRAMA_NOT_ON_SHELF;
7192
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
+ };
7193
7491
  readonly FAILED_GET_EPISODE_INFO: {
7194
7492
  readonly code: 9399;
7195
7493
  readonly message: "Failed get episode info";
7196
7494
  readonly textKey: LangTextKey.DRAMA_FAILED_GET_EPISODE_INFO;
7197
7495
  };
7198
7496
  };
7199
- declare class AuthToken extends SdkPlugin {
7200
- static get pluginName(): string;
7201
- isPlayByToken: boolean;
7202
- isEncrypt: boolean;
7203
- tokenInfo: ITokenInfo;
7204
- keyTokenInfo: ITokenInfo;
7205
- thirdPartyDrmAuthTokenInfo: ITokenInfo;
7206
- config: IPlayAuthTokenConfig;
7207
- privateDrmAuthToken: string;
7208
- useUnionInfoDRM: boolean;
7209
- sessionId: string;
7210
- retryCount: number;
7211
- playInfo?: VideoInfoRes;
7212
- constructor(args: any);
7213
- beforePlayerCreate(): Promise<void>;
7214
- getVideoInfo(sourceConfigs?: IPlayerConfig): Promise<{
7215
- vid: string;
7216
- __mediaInfoCacheHit: boolean;
7217
- playList: Stream[];
7218
- codec: ICodecType;
7219
- defaultDefinition: string;
7220
- }>;
7221
- /**
7222
- * 短剧 Minis 环境:通过 JSB getDramaInfo 获取媒体信息
7223
- */
7224
- getDramaInfoViaJSB(sourceConfigs?: IPlayerConfig): Promise<VideoInfoRes | undefined>;
7225
- /**
7226
- * 将审核状态映射到短剧错误码
7227
- */
7228
- mapReviewStatusToErrorCode(status: number): keyof typeof DRAMA_ERROR_CODE;
7229
- /**
7230
- * 根据 JSB 返回的 msg 或 status 映射到错误码 key
7231
- */
7232
- mapDramaErrorCode(msg: string, status?: number): keyof typeof DRAMA_ERROR_CODE;
7233
- /**
7234
- * 将 JSB 返回的 video_info 转换为 VideoInfoRes 格式
7235
- */
7236
- transformDramaVideoInfoToRes(videoInfo: any, config: IPlayAuthTokenConfig): VideoInfoRes;
7237
- callOnGetMediaInfo(mediaInfo: VideoInfoRes | undefined, fromCache: boolean): void;
7238
- reportGetDramaInfoPerf(res: IJSBCallbackResult | undefined, request: {
7239
- albumId?: string;
7240
- episodeId?: string;
7241
- vid?: string;
7242
- }): void;
7243
- getVideos(sourceConfigs?: IPlayerConfig): Promise<any>;
7244
- getPrivateDrmInfo(playList: Stream[], vid: string, streamType: string): Promise<void>;
7245
- getThumbnailConfig(thumbs: IThumbInfoItem[]): void;
7246
- getBarrageMaskUrl(url: string): void;
7247
- setSubtitleConfig(mediaInfo: VideoInfoRes | undefined): void;
7248
- getAutoSubtitleList(mediaInfo: VideoInfoRes): ISubTitleItem[];
7249
- getSubtitleSourceData(mediaInfo: VideoInfoRes): any;
7250
- getAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
7251
- getStringAutoSubtitleItem(item: string, index: number): ISubTitleItem;
7252
- getObjectAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
7253
- formatAutoSubtitleItem(subtitleItem: ISubTitleItem, rawItem: any, index: number): ISubTitleItem | undefined;
7254
- getDrmConfig(videoInfo: IVideoInfo): void;
7255
- /**
7256
- * 是否处于短剧 Minis 环境(通过剧 ID + 剧集 ID 获取视频)
7257
- */
7258
- get isMinisDramaMode(): boolean;
7259
- init(): void;
7260
- initConfig(getVideoByToken: IPlayAuthTokenConfig, sourceConfigs?: IPlayerConfig): void;
7261
- /**
7262
- * 剧集切换:configs 已由 player 更新 album_id/episode_id,重新拉取媒体信息
7263
- */
7264
- updateDramaEpisode(isNewVideo: boolean, candidateConfig?: IPlayerConfig): Promise<void>;
7265
- /**
7266
- * @description 更新playAuthToken
7267
- * @param {IPlayAuthTokenConfig} getVideoByToken token信息
7268
- * @param {boolean} isNewVideo 是否新视频,即是否为切换视频
7269
- */
7270
- updateAuthToken(getVideoByToken: IPlayAuthTokenConfig, isNewVideo: boolean): Promise<void>;
7271
- checkPlayAuthTokenValid(): boolean;
7272
- checkKeyTokenValid(): boolean;
7273
- checkDrmAuthTokenValid(): boolean;
7274
- }
7275
- /** {zh}
7276
- * @hidden
7277
- */
7278
- /** {en}
7279
- * @hidden
7280
- */
7281
- export interface IAdaptRangeDefaultOptions {
7282
- maxTargetCacheDur: number;
7283
- minTargetCacheDur: number;
7284
- rangeMaxDuration: number;
7285
- rangeMinDuration: number;
7286
- cacheSafeFactor: number;
7287
- estPTcontrol: boolean;
7288
- estPlayTime: number;
7289
- minBandwidth: number;
7290
- minDangerThreshold: number;
7291
- rangeControl: boolean;
7292
- rangeMinSize: number;
7293
- safeFactor: number;
7294
- targetCacheControl: boolean;
7295
- }
7296
- declare abstract class AbstractBaseAdapter {
7297
- isLive: boolean;
7298
- playerData: PlayerData;
7299
- streamType: string;
7300
- constructor(options: {
7301
- configs: IPlayerConfig;
7302
- playerData: PlayerData;
7303
- streamType: string;
7304
- });
7305
- /**
7306
- * @description 是否使用原生video的abr能力
7307
- */
7308
- abstract useNativeAbr(): boolean;
7309
- abstract canOpenAbr(vidPlayInfo?: VideoInfoRes): boolean;
7310
- abstract applyAbrPluginConfig(_finalOptions: any, _autoBitrateOpts: any): void;
7311
- abstract prepareAbrModule(_playerData: any, _sdkUmdLoader: any): void;
7312
- abstract needAbrAutoDefinition(): boolean;
7313
- abstract setAbrDefaultDefiWithAuto(): boolean;
7314
- abstract generatePlaylistFromServer(res: VideoInfoRes, ...args: any[]): Stream[];
7315
- abstract canAdaptRangeEnable(): boolean;
7316
- abstract adaptRangeDefaultOptions(): IAdaptRangeDefaultOptions | undefined;
7317
- abstract applyAdaptRangePluginConfig(_finalOptions: any, _adaptRangeOptions: any): void;
7318
- abstract applyAdaptRangeStrategy(_finalOptions: any, _adaptRangeOptions: any): void;
7319
- abstract getPlugins(umdLoader: UMDLoader): Promise<XGPlugin[]>;
7320
- abstract setPluginConfigInVid(videoInfo: IVideoInfo, context: AuthToken): void;
7321
- }
7322
7497
  /** {zh}
7323
7498
  * @list Options
7324
7499
  * @brief 字幕项。
@@ -7551,6 +7726,162 @@ export interface ITextItem {
7551
7726
  */
7552
7727
  export type HlsAbrEngine = "hlsjs" | "veplayer";
7553
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
+ }
7554
7885
  declare class PlayerData {
7555
7886
  id?: string;
7556
7887
  root?: HTMLElement;
@@ -7650,7 +7981,7 @@ declare class PlayerData {
7650
7981
  /**
7651
7982
  * @description: 获取当前的streamType
7652
7983
  */
7653
- getCurrentStreamType(): string;
7984
+ getCurrentStreamType(fallback?: string): string;
7654
7985
  getStreamType(): string;
7655
7986
  getConfiguredHlsAbrEngine(): HlsAbrEngine;
7656
7987
  isOpenVePlayerABR(): boolean;
@@ -8029,6 +8360,9 @@ export declare type IMediaInfoPrefetchFailure = {
8029
8360
  error: {
8030
8361
  code: number;
8031
8362
  message: string;
8363
+ /** {zh} @brief 获取剧集信息失败的安全诊断。 */
8364
+ /** {en} @brief Safe diagnostics for a failed drama info request. */
8365
+ diagnostics?: DramaDiagnostics;
8032
8366
  };
8033
8367
  };
8034
8368
  /** {zh}
@@ -8411,6 +8745,7 @@ declare function getMediaInfoCacheConfig(): NormalizedMediaInfoCacheConfig;
8411
8745
  export interface DramaIdentity {
8412
8746
  albumId: string | null;
8413
8747
  episodeId: string | null;
8748
+ vid: string | null;
8414
8749
  }
8415
8750
  export declare type PlayerPlaybackState = "creating" | "ready" | "playing" | "paused" | "buffering" | "ended" | "error" | "destroyed";
8416
8751
  export interface PlayerPlaybackStateSnapshot extends DramaIdentity {
@@ -8744,6 +9079,23 @@ declare class VePlayer {
8744
9079
  * ```
8745
9080
  */
8746
9081
  static prefetchMediaInfo(sources: IMediaInfoPrefetchSource[]): Promise<IMediaInfoPrefetchResult[]>;
9082
+ /** {zh}
9083
+ * @brief 全局设置是否为 MSE 媒体请求添加 x-tt-trace-id,默认关闭。
9084
+ * @param enable - 是否开启。新建播放器或下一次 playNext 时生效,当前播放保持原设置。
9085
+ * @notes 开启前需确保 CDN 的 CORS 配置允许 x-tt-trace-id。独立预加载不添加该请求头。
9086
+ * @example
9087
+ * VePlayer.setMediaTraceEnabled(true);
9088
+ * @list Api
9089
+ */
9090
+ /** {en}
9091
+ * @brief Globally enable x-tt-trace-id on MSE media requests. Disabled by default.
9092
+ * @param enable - Applies to new players and the next playNext; the current playback is unchanged.
9093
+ * @notes The CDN must allow x-tt-trace-id in CORS. Independent preloads do not include this header.
9094
+ * @example
9095
+ * VePlayer.setMediaTraceEnabled(true);
9096
+ * @list Api
9097
+ */
9098
+ static setMediaTraceEnabled(enable: boolean): void;
8747
9099
  /** {zh}
8748
9100
  * @brief 设置全局日志开关。开启后会输出 VE_DEBUG.log 级别日志。
8749
9101
  * @param enable 是否开启详细日志
@@ -9301,6 +9653,7 @@ declare class VePlayer {
9301
9653
  * @memberof VePlayer
9302
9654
  */
9303
9655
  updateAuthToken(config: IPlayAuthTokenConfig): Promise<void>;
9656
+ private _finishMediaPreparation;
9304
9657
  private _playerPlayNext;
9305
9658
  /** {zh}
9306
9659
  * @brief 返回当前视频的地址。
@@ -9380,6 +9733,7 @@ declare class VePlayer {
9380
9733
  private _buildDramaInvalidParamError;
9381
9734
  private _getDramaAlbumIdFromConfig;
9382
9735
  private _getDramaEpisodeIdFromConfig;
9736
+ private _reportPlayNextFailure;
9383
9737
  private switchDramaEpisode;
9384
9738
  /** {zh}
9385
9739
  * @brief 销毁xgplayer实例