@byteplus/veplayer 1.15.3-rc.18 → 1.15.3-rc.19

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.
Files changed (3) hide show
  1. package/index.d.ts +88 -33
  2. package/index.min.js +2 -2
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2316,6 +2316,16 @@ export interface MinisError {
2316
2316
  error_msg: string;
2317
2317
  error_extra?: unknown;
2318
2318
  }
2319
+ /**
2320
+ * JSB getDramaInfo 返回的客户端耗时信息,单位 ms。
2321
+ */
2322
+ export interface IGetDramaInfoPerfInfo {
2323
+ prepare_cost?: number;
2324
+ request_cost?: number;
2325
+ parse_cost?: number;
2326
+ total_cost?: number;
2327
+ [propName: string]: any;
2328
+ }
2319
2329
  /**
2320
2330
  * JSB 获取短剧信息返回结果
2321
2331
  */
@@ -2337,6 +2347,7 @@ export interface IJSBCallbackResult {
2337
2347
  episode_description: string;
2338
2348
  };
2339
2349
  video_info: IGetPlayInfoRes | Record<string, any>;
2350
+ perf_info?: IGetDramaInfoPerfInfo;
2340
2351
  };
2341
2352
  }
2342
2353
  /** {zh}
@@ -2797,6 +2808,53 @@ export interface IGetMediaInfoCallbackPayload {
2797
2808
  */
2798
2809
  fromCache: boolean;
2799
2810
  }
2811
+ /** {zh}
2812
+ * @list Options
2813
+ * @kind property
2814
+ * @brief JSB getDramaInfo 客户端耗时回调参数。
2815
+ */
2816
+ /** {en}
2817
+ * @list Options
2818
+ * @kind property
2819
+ * @brief Callback payload for client-side getDramaInfo timing returned by JSB.
2820
+ */
2821
+ export interface IGetDramaInfoPerfCallbackPayload {
2822
+ /** {zh}
2823
+ * @brief JSB 返回的客户端耗时信息,单位 ms。
2824
+ */
2825
+ /** {en}
2826
+ * @brief Client-side timing returned by JSB, in milliseconds.
2827
+ */
2828
+ perfInfo: IGetDramaInfoPerfInfo;
2829
+ /** {zh}
2830
+ * @brief 剧 ID。
2831
+ */
2832
+ albumId?: string;
2833
+ /** {zh}
2834
+ * @brief 剧集 ID。
2835
+ */
2836
+ episodeId?: string;
2837
+ /** {zh}
2838
+ * @brief 视频 ID。
2839
+ */
2840
+ vid?: string;
2841
+ /** {zh}
2842
+ * @brief JSB 是否请求成功。
2843
+ */
2844
+ isSuccess: boolean;
2845
+ /** {zh}
2846
+ * @brief 短剧审核状态。
2847
+ */
2848
+ status?: number;
2849
+ /** {zh}
2850
+ * @brief 是否来自缓存。getDramaInfo 实际请求返回时固定为 false。
2851
+ */
2852
+ fromCache: boolean;
2853
+ /** {zh}
2854
+ * @brief SDK 收到回调时的时间戳。
2855
+ */
2856
+ timestamp: number;
2857
+ }
2800
2858
  /** {zh}
2801
2859
  * @list Options
2802
2860
  * @kind property
@@ -2865,6 +2923,15 @@ export interface IPlayerConfig extends IPlayerOptions {
2865
2923
  * @default -
2866
2924
  */
2867
2925
  onGetMediaInfo?: (payload: IGetMediaInfoCallbackPayload) => void;
2926
+ /** {zh}
2927
+ * @brief JSB `getDramaInfo` 返回客户端耗时信息时触发的回调。
2928
+ * @default -
2929
+ */
2930
+ /** {en}
2931
+ * @brief Callback fired when JSB `getDramaInfo` returns client-side timing.
2932
+ * @default -
2933
+ */
2934
+ onGetDramaInfoPerf?: (payload: IGetDramaInfoPerfCallbackPayload) => void;
2868
2935
  /** {zh}
2869
2936
  * @brief 是否自动使用 `playAuthToken` 或短剧信息返回的字幕列表。
2870
2937
  * @default false
@@ -4904,7 +4971,6 @@ export declare const enum LangTextKey {
4904
4971
  DRAMA_WITHDRAWN_REVIEW = "DRAMA_WITHDRAWN_REVIEW",
4905
4972
  DRAMA_FAILED_TO_QUERY = "DRAMA_FAILED_TO_QUERY",
4906
4973
  DRAMA_INVALID_TTOP_TOKEN = "DRAMA_INVALID_TTOP_TOKEN",
4907
- DRAMA_INVALID_PLAY_DOMAIN = "DRAMA_INVALID_PLAY_DOMAIN",
4908
4974
  DRAMA_NOT_ON_SHELF = "DRAMA_NOT_ON_SHELF",
4909
4975
  DRAMA_FAILED_GET_EPISODE_INFO = "DRAMA_FAILED_GET_EPISODE_INFO"
4910
4976
  }
@@ -4950,11 +5016,6 @@ declare const DRAMA_ERROR_CODE: {
4950
5016
  readonly message: "Invalid playAuthToken or failed to verify TTOP token";
4951
5017
  readonly textKey: LangTextKey.DRAMA_INVALID_TTOP_TOKEN;
4952
5018
  };
4953
- readonly INVALID_PLAY_DOMAIN: {
4954
- readonly code: 9309;
4955
- readonly message: "Invalid play domain";
4956
- readonly textKey: LangTextKey.DRAMA_INVALID_PLAY_DOMAIN;
4957
- };
4958
5019
  readonly NOT_ON_SHELF: {
4959
5020
  readonly code: 9310;
4960
5021
  readonly message: "Video is not on shelf";
@@ -5003,12 +5064,13 @@ declare class AuthToken extends SdkPlugin {
5003
5064
  * 将 JSB 返回的 video_info 转换为 VideoInfoRes 格式
5004
5065
  */
5005
5066
  transformDramaVideoInfoToRes(videoInfo: any, config: IPlayAuthTokenConfig): VideoInfoRes;
5006
- /**
5007
- * 短剧环境(宿主注入 ttDramaEnv):校验每条主播放地址域名须为 *.tiktok-minis-vod.us
5008
- */
5009
- ensureMinisDramaPlayDomainOrReject(videoInfoRes: VideoInfoRes | undefined): VideoInfoRes | undefined;
5010
5067
  callOnGetMediaInfo(mediaInfo: VideoInfoRes | undefined, fromCache: boolean): void;
5011
- getVideos(): Promise<VideoInfoRes>;
5068
+ reportGetDramaInfoPerf(res: IJSBCallbackResult | undefined, request: {
5069
+ albumId?: string;
5070
+ episodeId?: string;
5071
+ vid?: string;
5072
+ }): void;
5073
+ getVideos(): Promise<any>;
5012
5074
  getPrivateDrmInfo(playList: Stream[], vid: string, streamType: string): Promise<void>;
5013
5075
  getThumbnailConfig(thumbs: IThumbInfoItem[]): void;
5014
5076
  getBarrageMaskUrl(url: string): void;
@@ -5429,6 +5491,8 @@ declare class VePlayer {
5429
5491
  * 最近一次 createPlayer 性能报告
5430
5492
  */
5431
5493
  private _lastCreatePlayerPerfReport?;
5494
+ private _isCollectingCreatePlayerPerf;
5495
+ private _getDramaInfoPerfRecords;
5432
5496
  /**
5433
5497
  *
5434
5498
  *
@@ -5471,28 +5535,6 @@ declare class VePlayer {
5471
5535
  * @memberof VePlayer
5472
5536
  */
5473
5537
  delayError: any[];
5474
- /**
5475
- * @hidden
5476
- * When enabled, bypass `short video minis drama` play-domain validation.
5477
- * This is only used for `ttDramaEnv` scenarios.
5478
- */
5479
- private static _skipMinisDramaPlayDomainValidation;
5480
- /** {zh}
5481
- * @brief 跳过短剧 minis 播放域名校验(仅影响 `ttDramaEnv` 下的主播放地址校验)。
5482
- * @param skip true=跳过校验,false=恢复校验
5483
- */
5484
- /** {en}
5485
- * @brief Skip minis drama play-domain validation (only affects `ttDramaEnv` scenarios).
5486
- * @param skip true=skip validation, false=restore validation
5487
- */
5488
- static setSkipMinisDramaPlayDomainValidation(skip?: boolean): void;
5489
- /** {zh}
5490
- * @hidden
5491
- */
5492
- /** {en}
5493
- * @hidden
5494
- */
5495
- static getSkipMinisDramaPlayDomainValidation(): boolean;
5496
5538
  /** {zh}
5497
5539
  * @brief 设置是否为通过短剧信息或 playAuthToken 获取到的视频地址追加时间戳 query(t=Date.now())。
5498
5540
  * @param enable true=追加时间戳,false=不追加
@@ -5843,6 +5885,19 @@ declare class VePlayer {
5843
5885
  * @brief Get the perf report of the latest createPlayer.
5844
5886
  */
5845
5887
  getCreatePlayerPerfReport(): ICreatePlayerPerfReport;
5888
+ /**
5889
+ * @brief 记录一次 JSB getDramaInfo 返回的客户端耗时信息。
5890
+ */
5891
+ recordGetDramaInfoPerf(payload: IGetDramaInfoPerfCallbackPayload): void;
5892
+ /**
5893
+ * @brief 获取当前播放器实例记录到的 getDramaInfo 客户端耗时列表。
5894
+ */
5895
+ getDramaInfoPerfRecords(): IGetDramaInfoPerfCallbackPayload[];
5896
+ /**
5897
+ * @brief 获取最近一次 getDramaInfo 客户端耗时。
5898
+ */
5899
+ getLastDramaInfoPerf(): IGetDramaInfoPerfCallbackPayload | undefined;
5900
+ private _markGetDramaInfoClientPerf;
5846
5901
  private prepareStrategies;
5847
5902
  /**
5848
5903
  * @hidden