@byteplus/veplayer 1.18.0-rc.6 → 1.18.0-rc.7

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
@@ -3176,6 +3176,8 @@ export interface ITTDramaEnv {
3176
3176
  * @type {boolean}
3177
3177
  */
3178
3178
  canIUseGetDramaInfo: boolean;
3179
+ /** 是否支持在 getDramaInfo 中透传 transcodeParam */
3180
+ canIUseGetDramaInfoTranscodeParam?: boolean;
3179
3181
  /**
3180
3182
  * @brief Android 是否支持批量获取短剧信息(高版本 app)
3181
3183
  * @type {boolean}
@@ -3206,6 +3208,20 @@ export interface IGetDramaInfoOptions {
3206
3208
  albumId: string;
3207
3209
  episodeId: string;
3208
3210
  vid: string;
3211
+ transcodeParam?: IGetDramaInfoTranscodeParam;
3212
+ }
3213
+ /** JSB/TTOP 使用的 snake_case 转码参数。 */
3214
+ export interface IGetDramaInfoTranscodeParam {
3215
+ format?: string;
3216
+ codec?: string;
3217
+ definition?: string;
3218
+ file_type?: string;
3219
+ need_thumbs?: string;
3220
+ need_barrage_mask?: string;
3221
+ union_info?: string;
3222
+ quality?: string;
3223
+ drm_kek?: string;
3224
+ js_player?: string;
3209
3225
  }
3210
3226
  export interface MinisError {
3211
3227
  error_code: number;
@@ -3970,6 +3986,24 @@ export interface IGetDramaInfoPerfCallbackPayload {
3970
3986
  */
3971
3987
  timestamp: number;
3972
3988
  }
3989
+ /** {zh}
3990
+ * @brief Minis 短剧转码参数。各字段会由 VePlayer 转换为服务端 snake_case 命名后透传。
3991
+ */
3992
+ /** {en}
3993
+ * @brief Minis short-drama transcoding parameters. VePlayer converts the fields to server-side snake_case names before forwarding them.
3994
+ */
3995
+ export interface ITranscodeParam {
3996
+ format?: string;
3997
+ codec?: string;
3998
+ definition?: string;
3999
+ fileType?: string;
4000
+ needThumbs?: string;
4001
+ needBarrageMask?: string;
4002
+ unionInfo?: string;
4003
+ quality?: string;
4004
+ drmKek?: string;
4005
+ jsPlayer?: string;
4006
+ }
3973
4007
  /** {zh}
3974
4008
  * @list Options
3975
4009
  * @kind property
@@ -4041,6 +4075,13 @@ export interface IPlayerConfig extends IPlayerOptions {
4041
4075
  * @brief 剧集id,Minis 短剧播放需要
4042
4076
  */
4043
4077
  episodeId?: string;
4078
+ /** {zh}
4079
+ * @brief Minis 短剧转码参数。
4080
+ */
4081
+ /** {en}
4082
+ * @brief Minis short-drama transcoding parameters.
4083
+ */
4084
+ transcodeParam?: ITranscodeParam;
4044
4085
  /** {zh}
4045
4086
  * @brief Vid 播放配置项。应用服务端需通过 `vid` 生成临时临时播放 Token,下发给客户端。
4046
4087
  * @type {IPlayAuthTokenConfig}
@@ -6427,7 +6468,7 @@ declare class AuthToken extends SdkPlugin {
6427
6468
  playInfo?: VideoInfoRes;
6428
6469
  constructor(args: any);
6429
6470
  beforePlayerCreate(): Promise<void>;
6430
- getVideoInfo(): Promise<{
6471
+ getVideoInfo(sourceConfigs?: IPlayerConfig): Promise<{
6431
6472
  vid: string;
6432
6473
  playList: Stream[];
6433
6474
  codec: ICodecType;
@@ -6436,7 +6477,7 @@ declare class AuthToken extends SdkPlugin {
6436
6477
  /**
6437
6478
  * 短剧 Minis 环境:通过 JSB getDramaInfo 获取媒体信息
6438
6479
  */
6439
- getDramaInfoViaJSB(): Promise<VideoInfoRes | undefined>;
6480
+ getDramaInfoViaJSB(sourceConfigs?: IPlayerConfig): Promise<VideoInfoRes | undefined>;
6440
6481
  /**
6441
6482
  * 将审核状态映射到短剧错误码
6442
6483
  */
@@ -6455,7 +6496,7 @@ declare class AuthToken extends SdkPlugin {
6455
6496
  episodeId?: string;
6456
6497
  vid?: string;
6457
6498
  }): void;
6458
- getVideos(): Promise<any>;
6499
+ getVideos(sourceConfigs?: IPlayerConfig): Promise<any>;
6459
6500
  getPrivateDrmInfo(playList: Stream[], vid: string, streamType: string): Promise<void>;
6460
6501
  getThumbnailConfig(thumbs: IThumbInfoItem[]): void;
6461
6502
  getBarrageMaskUrl(url: string): void;
@@ -6472,11 +6513,11 @@ declare class AuthToken extends SdkPlugin {
6472
6513
  */
6473
6514
  get isMinisDramaMode(): boolean;
6474
6515
  init(): void;
6475
- initConfig(getVideoByToken: IPlayAuthTokenConfig): void;
6516
+ initConfig(getVideoByToken: IPlayAuthTokenConfig, sourceConfigs?: IPlayerConfig): void;
6476
6517
  /**
6477
6518
  * 剧集切换:configs 已由 player 更新 album_id/episode_id,重新拉取媒体信息
6478
6519
  */
6479
- updateDramaEpisode(isNewVideo: boolean): Promise<void>;
6520
+ updateDramaEpisode(isNewVideo: boolean, candidateConfig?: IPlayerConfig): Promise<void>;
6480
6521
  /**
6481
6522
  * @description 更新playAuthToken
6482
6523
  * @param {IPlayAuthTokenConfig} getVideoByToken token信息
@@ -6679,6 +6720,10 @@ declare class PlayerData {
6679
6720
  */
6680
6721
  get playDomain(): string;
6681
6722
  setVodTeaId(): void;
6723
+ /**
6724
+ * 基于当前配置生成合并后的候选配置,不修改当前播放状态。
6725
+ */
6726
+ getMergedConfigs(newConfigs: IPlayerConfig): IPlayerConfig;
6682
6727
  /**
6683
6728
  * 更新configs,即更新用户的configs,常用于playNext时
6684
6729
  * @param newConfigs {IPlayerConfig} 要更新的配置
@@ -6928,7 +6973,26 @@ export declare type IPreloadDramaStream = {
6928
6973
  vid?: string;
6929
6974
  albumId: string;
6930
6975
  episodeId: string;
6976
+ /** {zh}
6977
+ * @brief 默认清晰度,仅用于从完整媒体信息中选择预加载流。
6978
+ */
6979
+ /** {en}
6980
+ * @brief Default definition used only to select a preload stream from complete media information.
6981
+ */
6931
6982
  defaultDefinition?: string;
6983
+ /** {zh}
6984
+ * @brief Minis 短剧转码参数。
6985
+ */
6986
+ /** {en}
6987
+ * @brief Transcoding parameters for Minis short dramas.
6988
+ */
6989
+ transcodeParam?: ITranscodeParam;
6990
+ /** {zh}
6991
+ * @brief Vid 播放配置。短剧预加载会复用 playAuthToken 等配置请求短剧信息。
6992
+ */
6993
+ /** {en}
6994
+ * @brief Vid playback configuration reused by short-drama preload requests.
6995
+ */
6932
6996
  getVideoByToken?: IPlayAuthTokenConfig;
6933
6997
  };
6934
6998
  export declare type IPreloadAuthTokenStream = {
@@ -7477,6 +7541,19 @@ export declare type NormalizedMediaInfoCacheConfig = {
7477
7541
  maxEntries: number;
7478
7542
  };
7479
7543
  declare function getMediaInfoCacheConfig(): NormalizedMediaInfoCacheConfig;
7544
+ export interface DramaIdentity {
7545
+ albumId: string | null;
7546
+ episodeId: string | null;
7547
+ }
7548
+ export declare type PlayerPlaybackState = "creating" | "ready" | "playing" | "paused" | "buffering" | "ended" | "error" | "destroyed";
7549
+ export interface PlayerPlaybackStateSnapshot extends DramaIdentity {
7550
+ playbackState: PlayerPlaybackState;
7551
+ isEnded: boolean;
7552
+ isPaused: boolean;
7553
+ isBeforePlayerCreate: boolean;
7554
+ duration: number;
7555
+ currentTime: number;
7556
+ }
7480
7557
  /** {zh}
7481
7558
  * @hidden
7482
7559
  */
@@ -7529,6 +7606,15 @@ export interface EncryptInfo {
7529
7606
  unionInfo: string;
7530
7607
  }
7531
7608
  declare class VePlayer {
7609
+ /** {zh}
7610
+ * @brief 供 JSSDK 门面查询当前播放器播放状态。
7611
+ * @hidden
7612
+ */
7613
+ /** {en}
7614
+ * @brief Returns the current player playback state for the JSSDK facade.
7615
+ * @hidden
7616
+ */
7617
+ static getPlayerPlaybackState(): PlayerPlaybackStateSnapshot | null;
7532
7618
  /**
7533
7619
  * 注册业务已打包的 UMD 模块,供所有后续创建的播放器共享使用。
7534
7620
  */
@@ -8021,6 +8107,7 @@ declare class VePlayer {
8021
8107
  * @memberof VePlayer
8022
8108
  */
8023
8109
  createPlayer: () => Promise<PlayerCore>;
8110
+ private _createPlayer;
8024
8111
  private checkLicenseCallback;
8025
8112
  /** {zh}
8026
8113
  * @hidden
@@ -8354,6 +8441,7 @@ declare class VePlayer {
8354
8441
  playNext(config: IPlayerConfig, isNewVideo?: boolean): Promise<any>;
8355
8442
  private updatePlayNextSubtitleConfig;
8356
8443
  private _playNext;
8444
+ private _createDramaPlayNextCandidateConfig;
8357
8445
  /** 从 playerData.configs 取出短剧 id,供 XGPlayer setConfig / playNext 与切换后 configs 一致 */
8358
8446
  private _getDramaConfigPatchForPlayer;
8359
8447
  private _buildDramaInvalidParamError;
@@ -8736,8 +8824,15 @@ declare class VePlayer {
8736
8824
  */
8737
8825
  hideSubtitle(): void;
8738
8826
  /** {zh}
8739
- * @memberof VePlayer
8827
+ * @hidden
8828
+ */
8829
+ /** {en}
8830
+ * @hidden
8831
+ */
8832
+ private _teardown;
8833
+ /** {zh}
8740
8834
  * @brief 销毁当前播放器实例。
8835
+ * @memberof VePlayer
8741
8836
  */
8742
8837
  /** {en}
8743
8838
  * @brief Destroy the current player instance.