@volcengine/veplayer 1.15.3-rc.12 → 1.15.3-rc.13
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 +35 -2
- package/index.min.js +2 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -669,6 +669,11 @@ export interface ISubTitleItem {
|
|
|
669
669
|
* @brief 字幕名称
|
|
670
670
|
*/
|
|
671
671
|
text?: string;
|
|
672
|
+
/**
|
|
673
|
+
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
674
|
+
* @default -
|
|
675
|
+
*/
|
|
676
|
+
label?: string | number;
|
|
672
677
|
/**
|
|
673
678
|
* @brief 外挂字幕 URL 地址。
|
|
674
679
|
* @default -
|
|
@@ -697,6 +702,16 @@ export interface ISubTitleItem {
|
|
|
697
702
|
*/
|
|
698
703
|
list?: IListItem[];
|
|
699
704
|
}
|
|
705
|
+
export declare type IAutoSubtitleSourceItem = Record<string, any> | string;
|
|
706
|
+
export declare type IAutoSubtitleFormatterResult = string | number | boolean | null | undefined | {
|
|
707
|
+
label?: string | number;
|
|
708
|
+
text?: string | number;
|
|
709
|
+
show?: boolean;
|
|
710
|
+
visible?: boolean;
|
|
711
|
+
/** 排序权重,值越小越靠前。未指定时保持原始顺序。 */
|
|
712
|
+
order?: number;
|
|
713
|
+
};
|
|
714
|
+
export declare type IAutoSubtitleItemFormatter = (item: IAutoSubtitleSourceItem, index: number) => IAutoSubtitleFormatterResult;
|
|
700
715
|
/**
|
|
701
716
|
* @brief 字幕内容项。
|
|
702
717
|
* @list Options
|
|
@@ -2185,6 +2200,7 @@ export interface ISubtitleInfoList {
|
|
|
2185
2200
|
Version: string;
|
|
2186
2201
|
Vid: string;
|
|
2187
2202
|
}
|
|
2203
|
+
export declare type ISubtitleInfoListItem = ISubtitleInfoList | string;
|
|
2188
2204
|
/** {zh}
|
|
2189
2205
|
* @hidden
|
|
2190
2206
|
*/
|
|
@@ -2243,7 +2259,7 @@ export interface IGetPlayInfoRes {
|
|
|
2243
2259
|
PlayInfoList: IPlayInfoListItem[];
|
|
2244
2260
|
PosterUrl: string;
|
|
2245
2261
|
Status: number;
|
|
2246
|
-
SubtitleInfoList
|
|
2262
|
+
SubtitleInfoList?: ISubtitleInfoListItem[];
|
|
2247
2263
|
ThumbInfoList: IThumbInfoItem[];
|
|
2248
2264
|
TotalCount: number;
|
|
2249
2265
|
Version: number;
|
|
@@ -2320,7 +2336,7 @@ export interface IJSBCallbackResult {
|
|
|
2320
2336
|
episode_cover: string;
|
|
2321
2337
|
episode_description: string;
|
|
2322
2338
|
};
|
|
2323
|
-
video_info: IGetPlayInfoRes
|
|
2339
|
+
video_info: IGetPlayInfoRes | Record<string, any>;
|
|
2324
2340
|
};
|
|
2325
2341
|
}
|
|
2326
2342
|
/** {zh}
|
|
@@ -2849,6 +2865,16 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
2849
2865
|
* @default -
|
|
2850
2866
|
*/
|
|
2851
2867
|
onGetMediaInfo?: (payload: IGetMediaInfoCallbackPayload) => void;
|
|
2868
|
+
/** {zh}
|
|
2869
|
+
* @brief 是否自动使用 `playAuthToken` 或短剧信息返回的字幕列表。
|
|
2870
|
+
* @default false
|
|
2871
|
+
*/
|
|
2872
|
+
autoSubtitle?: boolean;
|
|
2873
|
+
/** {zh}
|
|
2874
|
+
* @brief 自动字幕项格式化回调。返回字符串或数字时作为字幕名称;返回 `false` 或 `{ show: false }` 时不展示该项。
|
|
2875
|
+
* @default -
|
|
2876
|
+
*/
|
|
2877
|
+
formatAutoSubtitleItem?: IAutoSubtitleItemFormatter;
|
|
2852
2878
|
/** {zh}
|
|
2853
2879
|
* @brief 视频加密类型
|
|
2854
2880
|
* @default -
|
|
@@ -4816,6 +4842,13 @@ declare class AuthToken extends SdkPlugin {
|
|
|
4816
4842
|
getPrivateDrmInfo(playList: Stream[], vid: string, streamType: string): Promise<void>;
|
|
4817
4843
|
getThumbnailConfig(thumbs: IThumbInfoItem[]): void;
|
|
4818
4844
|
getBarrageMaskUrl(url: string): void;
|
|
4845
|
+
setSubtitleConfig(mediaInfo: VideoInfoRes | undefined): void;
|
|
4846
|
+
getAutoSubtitleList(mediaInfo: VideoInfoRes): ISubTitleItem[];
|
|
4847
|
+
getSubtitleSourceData(mediaInfo: VideoInfoRes): any;
|
|
4848
|
+
getAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
|
|
4849
|
+
getStringAutoSubtitleItem(item: string, index: number): ISubTitleItem;
|
|
4850
|
+
getObjectAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
|
|
4851
|
+
formatAutoSubtitleItem(subtitleItem: ISubTitleItem, rawItem: any, index: number): ISubTitleItem | undefined;
|
|
4819
4852
|
getDrmConfig(videoInfo: IVideoInfo): void;
|
|
4820
4853
|
/**
|
|
4821
4854
|
* 是否处于短剧 Minis 环境(通过剧 ID + 剧集 ID 获取视频)
|