@byteplus/veplayer 1.20.0-rc.6 → 1.20.0-rc.8

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
@@ -3455,6 +3455,12 @@ export interface IGetDramaInfoPerfInfo {
3455
3455
  * JSB 获取短剧信息返回结果
3456
3456
  */
3457
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;
3458
3464
  /** {zh} @brief 旧回包的顶层 Native 通参;优先使用 data.tracking_context。 */
3459
3465
  /** {en} @brief Legacy top-level tracking fields; data.tracking_context takes priority. */
3460
3466
  tracking_context?: {
@@ -4774,19 +4780,19 @@ export interface IPlayerConfig extends IPlayerOptions {
4774
4780
  /** {zh}
4775
4781
  * @brief 起播和 playNext 的 getDramaInfo JSB 超时与重试配置。
4776
4782
  * @list Options
4777
- * @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 为非负数;无效值回退默认值。
4778
4784
  * @example
4779
4785
  * ```javascript
4780
- * new VePlayer({ dramaInfoRequest: { timeout: 3000, retryCount: 3, retryInterval: 1000 } });
4786
+ * new VePlayer({ dramaInfoRequest: { timeout: 10000, retryCount: 3, retryInterval: 1000 } });
4781
4787
  * ```
4782
4788
  */
4783
4789
  /** {en}
4784
4790
  * @brief Configure getDramaInfo JSB timeouts and retries for startup and playNext.
4785
4791
  * @list Options
4786
- * @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.
4787
4793
  * @example
4788
4794
  * ```javascript
4789
- * new VePlayer({ dramaInfoRequest: { timeout: 3000, retryCount: 3, retryInterval: 1000 } });
4795
+ * new VePlayer({ dramaInfoRequest: { timeout: 10000, retryCount: 3, retryInterval: 1000 } });
4790
4796
  * ```
4791
4797
  */
4792
4798
  dramaInfoRequest?: {
@@ -7183,6 +7189,46 @@ export declare const enum LangTextKey {
7183
7189
  DRAMA_NOT_ON_SHELF = "DRAMA_NOT_ON_SHELF",
7184
7190
  DRAMA_EMPTY_PLAYLIST = "DRAMA_EMPTY_PLAYLIST",
7185
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",
7186
7232
  DRAMA_FAILED_GET_EPISODE_INFO = "DRAMA_FAILED_GET_EPISODE_INFO"
7187
7233
  }
7188
7234
  declare const DRAMA_ERROR_CODE: {
@@ -7242,138 +7288,212 @@ declare const DRAMA_ERROR_CODE: {
7242
7288
  readonly message: "getDramaInfo request timed out";
7243
7289
  readonly textKey: LangTextKey.DRAMA_GET_INFO_TIMEOUT;
7244
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
+ };
7245
7491
  readonly FAILED_GET_EPISODE_INFO: {
7246
7492
  readonly code: 9399;
7247
7493
  readonly message: "Failed get episode info";
7248
7494
  readonly textKey: LangTextKey.DRAMA_FAILED_GET_EPISODE_INFO;
7249
7495
  };
7250
7496
  };
7251
- declare class AuthToken extends SdkPlugin {
7252
- static get pluginName(): string;
7253
- isPlayByToken: boolean;
7254
- isEncrypt: boolean;
7255
- tokenInfo: ITokenInfo;
7256
- keyTokenInfo: ITokenInfo;
7257
- thirdPartyDrmAuthTokenInfo: ITokenInfo;
7258
- config: IPlayAuthTokenConfig;
7259
- privateDrmAuthToken: string;
7260
- useUnionInfoDRM: boolean;
7261
- sessionId: string;
7262
- retryCount: number;
7263
- playInfo?: VideoInfoRes;
7264
- constructor(args: any);
7265
- beforePlayerCreate(): Promise<void>;
7266
- getVideoInfo(sourceConfigs?: IPlayerConfig, errors?: any[]): Promise<{
7267
- vid: string;
7268
- __mediaInfoCacheHit: boolean;
7269
- __serverFetchDuration: number;
7270
- __dramaTrackingContext: Record<string, unknown>;
7271
- playList: Stream[];
7272
- codec: ICodecType;
7273
- defaultDefinition: string;
7274
- }>;
7275
- private reportEmptyDramaPlaylist;
7276
- /**
7277
- * 短剧 Minis 环境:通过 JSB getDramaInfo 获取媒体信息
7278
- */
7279
- getDramaInfoViaJSB(sourceConfigs?: IPlayerConfig, errors?: any[]): Promise<VideoInfoRes | undefined>;
7280
- /**
7281
- * 将审核状态映射到短剧错误码
7282
- */
7283
- mapReviewStatusToErrorCode(status: number): keyof typeof DRAMA_ERROR_CODE;
7284
- /**
7285
- * 根据 JSB 返回的 msg 或 status 映射到错误码 key
7286
- */
7287
- mapDramaErrorCode(msg: string, status?: number): keyof typeof DRAMA_ERROR_CODE;
7288
- /**
7289
- * 将 JSB 返回的 video_info 转换为 VideoInfoRes 格式
7290
- */
7291
- transformDramaVideoInfoToRes(videoInfo: any, config: IPlayAuthTokenConfig): VideoInfoRes;
7292
- callOnGetMediaInfo(mediaInfo: VideoInfoRes | undefined, fromCache: boolean): void;
7293
- reportGetDramaInfoPerf(res: IJSBCallbackResult | undefined, request: {
7294
- albumId?: string;
7295
- episodeId?: string;
7296
- vid?: string;
7297
- }): void;
7298
- getVideos(sourceConfigs?: IPlayerConfig, errors?: any[]): Promise<any>;
7299
- getPrivateDrmInfo(playList: Stream[], vid: string, streamType: string): Promise<void>;
7300
- getThumbnailConfig(thumbs: IThumbInfoItem[]): void;
7301
- getBarrageMaskUrl(url: string): void;
7302
- setSubtitleConfig(mediaInfo: VideoInfoRes | undefined): void;
7303
- getAutoSubtitleList(mediaInfo: VideoInfoRes): ISubTitleItem[];
7304
- getSubtitleSourceData(mediaInfo: VideoInfoRes): any;
7305
- getAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
7306
- getStringAutoSubtitleItem(item: string, index: number): ISubTitleItem;
7307
- getObjectAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
7308
- formatAutoSubtitleItem(subtitleItem: ISubTitleItem, rawItem: any, index: number): ISubTitleItem | undefined;
7309
- getDrmConfig(videoInfo: IVideoInfo): void;
7310
- /**
7311
- * 是否处于短剧 Minis 环境(通过剧 ID + 剧集 ID 获取视频)
7312
- */
7313
- get isMinisDramaMode(): boolean;
7314
- init(): void;
7315
- initConfig(getVideoByToken: IPlayAuthTokenConfig, sourceConfigs?: IPlayerConfig): void;
7316
- /**
7317
- * 剧集切换:configs 已由 player 更新 album_id/episode_id,重新拉取媒体信息
7318
- */
7319
- updateDramaEpisode(isNewVideo: boolean, candidateConfig?: IPlayerConfig, errors?: any[]): Promise<void>;
7320
- /**
7321
- * @description 更新playAuthToken
7322
- * @param {IPlayAuthTokenConfig} getVideoByToken token信息
7323
- * @param {boolean} isNewVideo 是否新视频,即是否为切换视频
7324
- */
7325
- updateAuthToken(getVideoByToken: IPlayAuthTokenConfig, isNewVideo: boolean): Promise<void>;
7326
- checkPlayAuthTokenValid(errors?: any[]): boolean;
7327
- checkKeyTokenValid(errors?: any[]): boolean;
7328
- checkDrmAuthTokenValid(errors?: any[]): boolean;
7329
- }
7330
- /** {zh}
7331
- * @hidden
7332
- */
7333
- /** {en}
7334
- * @hidden
7335
- */
7336
- export interface IAdaptRangeDefaultOptions {
7337
- maxTargetCacheDur: number;
7338
- minTargetCacheDur: number;
7339
- rangeMaxDuration: number;
7340
- rangeMinDuration: number;
7341
- cacheSafeFactor: number;
7342
- estPTcontrol: boolean;
7343
- estPlayTime: number;
7344
- minBandwidth: number;
7345
- minDangerThreshold: number;
7346
- rangeControl: boolean;
7347
- rangeMinSize: number;
7348
- safeFactor: number;
7349
- targetCacheControl: boolean;
7350
- }
7351
- declare abstract class AbstractBaseAdapter {
7352
- isLive: boolean;
7353
- playerData: PlayerData;
7354
- streamType: string;
7355
- constructor(options: {
7356
- configs: IPlayerConfig;
7357
- playerData: PlayerData;
7358
- streamType: string;
7359
- });
7360
- /**
7361
- * @description 是否使用原生video的abr能力
7362
- */
7363
- abstract useNativeAbr(): boolean;
7364
- abstract canOpenAbr(vidPlayInfo?: VideoInfoRes): boolean;
7365
- abstract applyAbrPluginConfig(_finalOptions: any, _autoBitrateOpts: any): void;
7366
- abstract prepareAbrModule(_playerData: any, _sdkUmdLoader: any): void;
7367
- abstract needAbrAutoDefinition(): boolean;
7368
- abstract setAbrDefaultDefiWithAuto(): boolean;
7369
- abstract generatePlaylistFromServer(res: VideoInfoRes, ...args: any[]): Stream[];
7370
- abstract canAdaptRangeEnable(): boolean;
7371
- abstract adaptRangeDefaultOptions(): IAdaptRangeDefaultOptions | undefined;
7372
- abstract applyAdaptRangePluginConfig(_finalOptions: any, _adaptRangeOptions: any): void;
7373
- abstract applyAdaptRangeStrategy(_finalOptions: any, _adaptRangeOptions: any): void;
7374
- abstract getPlugins(umdLoader: UMDLoader): Promise<XGPlugin[]>;
7375
- abstract setPluginConfigInVid(videoInfo: IVideoInfo, context: AuthToken): void;
7376
- }
7377
7497
  /** {zh}
7378
7498
  * @list Options
7379
7499
  * @brief 字幕项。
@@ -7606,6 +7726,162 @@ export interface ITextItem {
7606
7726
  */
7607
7727
  export type HlsAbrEngine = "hlsjs" | "veplayer";
7608
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
+ }
7609
7885
  declare class PlayerData {
7610
7886
  id?: string;
7611
7887
  root?: HTMLElement;
@@ -8084,6 +8360,9 @@ export declare type IMediaInfoPrefetchFailure = {
8084
8360
  error: {
8085
8361
  code: number;
8086
8362
  message: string;
8363
+ /** {zh} @brief 获取剧集信息失败的安全诊断。 */
8364
+ /** {en} @brief Safe diagnostics for a failed drama info request. */
8365
+ diagnostics?: DramaDiagnostics;
8087
8366
  };
8088
8367
  };
8089
8368
  /** {zh}