@volcengine/veplayer 1.15.3-rc.2 → 1.15.3-rc.20
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 +916 -292
- package/index.min.css +1 -1
- package/index.min.js +2 -2
- package/package.json +1 -1
- package/plugin/mp4Encrypt.js +2 -2
package/index.d.ts
CHANGED
|
@@ -80,21 +80,8 @@ export interface ISdkErrorConfig {
|
|
|
80
80
|
* @hidden
|
|
81
81
|
*/
|
|
82
82
|
isNeedDemoteBack?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* @brief 是否允许回退到同清晰度不同线路的 fallbackurl:
|
|
85
|
-
* - `false`:只能在当前 defintion 范围内 fallback。
|
|
86
|
-
* - `true`:允许 fallback 相同清晰度,不同的线路的 fallbackurl。
|
|
87
|
-
* @default true
|
|
88
|
-
*
|
|
89
|
-
*/
|
|
90
|
-
/** {en}
|
|
91
|
-
* @brief Is demote to different line enabled? The values are as follows:
|
|
92
|
-
* - `false`: only demote in current definition line.
|
|
93
|
-
* - `true`: allow demote to different line.
|
|
94
|
-
*/
|
|
95
|
-
allowDemoteToDifferentLine?: boolean;
|
|
96
83
|
/** {zh}
|
|
97
|
-
* @brief
|
|
84
|
+
* @brief 报错后重试次数。
|
|
98
85
|
* @default 1
|
|
99
86
|
*/
|
|
100
87
|
retryLoopNum?: number;
|
|
@@ -682,6 +669,11 @@ export interface ISubTitleItem {
|
|
|
682
669
|
* @brief 字幕名称
|
|
683
670
|
*/
|
|
684
671
|
text?: string;
|
|
672
|
+
/**
|
|
673
|
+
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
674
|
+
* @default -
|
|
675
|
+
*/
|
|
676
|
+
label?: string | number;
|
|
685
677
|
/**
|
|
686
678
|
* @brief 外挂字幕 URL 地址。
|
|
687
679
|
* @default -
|
|
@@ -710,6 +702,16 @@ export interface ISubTitleItem {
|
|
|
710
702
|
*/
|
|
711
703
|
list?: IListItem[];
|
|
712
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;
|
|
713
715
|
/**
|
|
714
716
|
* @brief 字幕内容项。
|
|
715
717
|
* @list Options
|
|
@@ -826,61 +828,6 @@ export interface IDefinitionDemotePlugin {
|
|
|
826
828
|
* - `true`: automatic downgrade is enabled.
|
|
827
829
|
*/
|
|
828
830
|
isNeedAutoDemote?: boolean;
|
|
829
|
-
/**
|
|
830
|
-
* @brief 当用户开启 fallbackUrl 降级(降级到备用线路) 时,优先降级清晰度还是 fallbackUrl,取值如下:
|
|
831
|
-
* - `false`:优先在同一个清晰度的所有 fallback 之间切换, 都有问题的情况下,再降低到下一个清晰度
|
|
832
|
-
* - `true`:优先降级清晰度, 清晰度降到最低之后,再在最后一个清晰度的 fallbackUrl 之间切换
|
|
833
|
-
* @default false
|
|
834
|
-
*
|
|
835
|
-
*/
|
|
836
|
-
/** {en}
|
|
837
|
-
* @brief Is demote quality first? The values are as follows:
|
|
838
|
-
* - `false`: not demote quality first.
|
|
839
|
-
* - `true`: demote quality first.
|
|
840
|
-
*/
|
|
841
|
-
shouldDemoteDefinitionFirst?: boolean;
|
|
842
|
-
/**
|
|
843
|
-
* @brief 是否开启 fallbackUrl 降级:
|
|
844
|
-
* - `false`:不尝试降级到备用线路。
|
|
845
|
-
* - `true`:尝试降级到备用线路。
|
|
846
|
-
* @default true
|
|
847
|
-
*
|
|
848
|
-
*/
|
|
849
|
-
/** {en}
|
|
850
|
-
* @brief Is automatic downgrade enabled? The values are as follows:
|
|
851
|
-
* - `false`: not try to play fallbackUrl first.
|
|
852
|
-
* - `true`: try to play fallbackUrl first before demote definition.
|
|
853
|
-
*/
|
|
854
|
-
isNeedDemoteBack?: boolean;
|
|
855
|
-
/**
|
|
856
|
-
* @brief 是否允许回退到同清晰度不同线路的 fallbackurl:
|
|
857
|
-
* - `false`:只能在当前 defintion 范围内 fallback。
|
|
858
|
-
* - `true`:允许 fallback 相同清晰度,不同的线路的 fallbackurl。
|
|
859
|
-
* @default true
|
|
860
|
-
*
|
|
861
|
-
*/
|
|
862
|
-
/** {en}
|
|
863
|
-
* @brief Is demote to different line enabled? The values are as follows:
|
|
864
|
-
* - `false`: only demote in current definition line.
|
|
865
|
-
* - `true`: allow demote to different line.
|
|
866
|
-
*/
|
|
867
|
-
allowDemoteToDifferentLine?: boolean;
|
|
868
|
-
/**
|
|
869
|
-
* @brief 同一清晰度降级至 fallbackurl 的重试轮数。
|
|
870
|
-
* @default 1
|
|
871
|
-
*/
|
|
872
|
-
/** {en}
|
|
873
|
-
* @brief The retry loop number for all available fallbackUrl.
|
|
874
|
-
*/
|
|
875
|
-
retryLoopNum?: number;
|
|
876
|
-
/**
|
|
877
|
-
* @brief 在降级时到下一个definition 时,是否显示 toast 提示。
|
|
878
|
-
* @default 1
|
|
879
|
-
*/
|
|
880
|
-
/** {en}
|
|
881
|
-
* @brief Whether to show toast when demote to next definition.
|
|
882
|
-
*/
|
|
883
|
-
bumpToastWhenDemoteToNextDefinition?: boolean;
|
|
884
831
|
/**
|
|
885
832
|
* @brief 清晰度降级顺序。数组中的元素需与 `playList` 中的 `definition` 相对应。
|
|
886
833
|
* @default []
|
|
@@ -942,10 +889,6 @@ export declare class DefinitionDemotePlugin extends Plugin {
|
|
|
942
889
|
longWaitingEmitTime: number;
|
|
943
890
|
waitingStartTime: number;
|
|
944
891
|
playerData: PlayerData;
|
|
945
|
-
fallbackState: {
|
|
946
|
-
retryTimes: number;
|
|
947
|
-
idx: number;
|
|
948
|
-
};
|
|
949
892
|
static get defaultConfig(): IDefinitionDemotePlugin;
|
|
950
893
|
constructor(args: any);
|
|
951
894
|
registerLanguageTexts(): {
|
|
@@ -965,12 +908,6 @@ export declare class DefinitionDemotePlugin extends Plugin {
|
|
|
965
908
|
_clearTime(): void;
|
|
966
909
|
clearState(): void;
|
|
967
910
|
demote(): void;
|
|
968
|
-
executeDemoteFallbackFirst(): void;
|
|
969
|
-
executeDemoteDefinitionFirst(): void;
|
|
970
|
-
getRetryListForCurrentDefinition(): any[];
|
|
971
|
-
getRetryListForCurrentDefinitionAcrossAllLines(): any[];
|
|
972
|
-
resetTimes(): void;
|
|
973
|
-
changeMainOrBackup(): boolean;
|
|
974
911
|
changeUrl(url: Url): void;
|
|
975
912
|
showToast(definition: Stream): void;
|
|
976
913
|
destroy(): void;
|
|
@@ -2263,6 +2200,7 @@ export interface ISubtitleInfoList {
|
|
|
2263
2200
|
Version: string;
|
|
2264
2201
|
Vid: string;
|
|
2265
2202
|
}
|
|
2203
|
+
export declare type ISubtitleInfoListItem = ISubtitleInfoList | string;
|
|
2266
2204
|
/** {zh}
|
|
2267
2205
|
* @hidden
|
|
2268
2206
|
*/
|
|
@@ -2321,11 +2259,97 @@ export interface IGetPlayInfoRes {
|
|
|
2321
2259
|
PlayInfoList: IPlayInfoListItem[];
|
|
2322
2260
|
PosterUrl: string;
|
|
2323
2261
|
Status: number;
|
|
2324
|
-
SubtitleInfoList
|
|
2262
|
+
SubtitleInfoList?: ISubtitleInfoListItem[];
|
|
2325
2263
|
ThumbInfoList: IThumbInfoItem[];
|
|
2326
2264
|
TotalCount: number;
|
|
2327
2265
|
Version: number;
|
|
2328
2266
|
}
|
|
2267
|
+
/**
|
|
2268
|
+
* 短剧环境配置接口
|
|
2269
|
+
*/
|
|
2270
|
+
export interface ITTDramaEnv {
|
|
2271
|
+
/** 云服务商,默认从构建时 env.__PLATFORM__ 获取,未注入时默认为 byteplus */
|
|
2272
|
+
channel?: "volcengine" | "byteplus";
|
|
2273
|
+
/**
|
|
2274
|
+
* @brief 应用版本号
|
|
2275
|
+
* @type {string}
|
|
2276
|
+
*/
|
|
2277
|
+
appVersion: string;
|
|
2278
|
+
/**
|
|
2279
|
+
* @brief 小程序三方id
|
|
2280
|
+
* @type {string}
|
|
2281
|
+
*/
|
|
2282
|
+
clientKey: string;
|
|
2283
|
+
/**
|
|
2284
|
+
* @brief 是否支持获取短剧信息
|
|
2285
|
+
* @type {boolean}
|
|
2286
|
+
*/
|
|
2287
|
+
canIUseGetDramaInfo: boolean;
|
|
2288
|
+
/**
|
|
2289
|
+
* @brief 获取短剧信息
|
|
2290
|
+
* @type {function}
|
|
2291
|
+
*/
|
|
2292
|
+
getDramaInfo: (callback: (res: IJSBCallbackResult) => void, options: IGetDramaInfoOptions) => void;
|
|
2293
|
+
videoSecurityModule?: any;
|
|
2294
|
+
/**
|
|
2295
|
+
* @brief 日志发送接口
|
|
2296
|
+
* @type {function}
|
|
2297
|
+
*/
|
|
2298
|
+
sendLog: (EventName: string, params: Record<string, any>) => void;
|
|
2299
|
+
/**
|
|
2300
|
+
* 低版本 app 下验证 TTOP 签发的 playAuthToken 时使用的密钥
|
|
2301
|
+
* 通过 JSB(如 minis.getSecret)从 Native 获取,用于 HMAC-SHA256 签名校验
|
|
2302
|
+
*/
|
|
2303
|
+
getTokenVerifySecret?: () => Promise<string>;
|
|
2304
|
+
}
|
|
2305
|
+
/**
|
|
2306
|
+
* JSB 获取短剧信息请求参数
|
|
2307
|
+
*/
|
|
2308
|
+
export interface IGetDramaInfoOptions {
|
|
2309
|
+
clientKey: string;
|
|
2310
|
+
albumId: string;
|
|
2311
|
+
episodeId: string;
|
|
2312
|
+
vid: string;
|
|
2313
|
+
}
|
|
2314
|
+
export interface MinisError {
|
|
2315
|
+
error_code: number;
|
|
2316
|
+
error_msg: string;
|
|
2317
|
+
error_extra?: unknown;
|
|
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
|
+
}
|
|
2329
|
+
/**
|
|
2330
|
+
* JSB 获取短剧信息返回结果
|
|
2331
|
+
*/
|
|
2332
|
+
export interface IJSBCallbackResult {
|
|
2333
|
+
is_success: number | boolean;
|
|
2334
|
+
error?: MinisError;
|
|
2335
|
+
data?: {
|
|
2336
|
+
status: number;
|
|
2337
|
+
drama_info: {
|
|
2338
|
+
album_id: string;
|
|
2339
|
+
drama_name: string;
|
|
2340
|
+
drama_cover: string;
|
|
2341
|
+
drama_description: string;
|
|
2342
|
+
};
|
|
2343
|
+
episode_info: {
|
|
2344
|
+
episode_id: string;
|
|
2345
|
+
episode_name: string;
|
|
2346
|
+
episode_cover: string;
|
|
2347
|
+
episode_description: string;
|
|
2348
|
+
};
|
|
2349
|
+
video_info: IGetPlayInfoRes | Record<string, any>;
|
|
2350
|
+
perf_info?: IGetDramaInfoPerfInfo;
|
|
2351
|
+
};
|
|
2352
|
+
}
|
|
2329
2353
|
/** {zh}
|
|
2330
2354
|
* @list Options
|
|
2331
2355
|
* @brief 视频编码格式。
|
|
@@ -2360,7 +2384,7 @@ export declare const CodecType: {
|
|
|
2360
2384
|
*/
|
|
2361
2385
|
readonly UNKNOWN: "unknown";
|
|
2362
2386
|
};
|
|
2363
|
-
export declare type ICodecType =
|
|
2387
|
+
export declare type ICodecType = typeof CodecType[keyof typeof CodecType];
|
|
2364
2388
|
export declare const ContentType: {
|
|
2365
2389
|
h265: string;
|
|
2366
2390
|
h264: string;
|
|
@@ -2751,6 +2775,86 @@ export declare type Url = string | Array<{
|
|
|
2751
2775
|
type?: string;
|
|
2752
2776
|
[propName: string]: any;
|
|
2753
2777
|
}>;
|
|
2778
|
+
/** {zh}
|
|
2779
|
+
* @list Options
|
|
2780
|
+
* @kind property
|
|
2781
|
+
* @brief 获取到媒体信息时的回调参数。
|
|
2782
|
+
*/
|
|
2783
|
+
/** {en}
|
|
2784
|
+
* @list Options
|
|
2785
|
+
* @kind property
|
|
2786
|
+
* @brief Callback payload when media information is obtained.
|
|
2787
|
+
*/
|
|
2788
|
+
export interface IGetMediaInfoCallbackPayload {
|
|
2789
|
+
/** {zh}
|
|
2790
|
+
* @brief 媒体信息。
|
|
2791
|
+
*/
|
|
2792
|
+
/** {en}
|
|
2793
|
+
* @brief Media information.
|
|
2794
|
+
*/
|
|
2795
|
+
data: {
|
|
2796
|
+
playList?: Stream[];
|
|
2797
|
+
type?: string;
|
|
2798
|
+
poster?: string;
|
|
2799
|
+
vid?: string;
|
|
2800
|
+
duration?: number;
|
|
2801
|
+
[propName: string]: any;
|
|
2802
|
+
};
|
|
2803
|
+
/** {zh}
|
|
2804
|
+
* @brief 媒体信息是否来自缓存。
|
|
2805
|
+
*/
|
|
2806
|
+
/** {en}
|
|
2807
|
+
* @brief Whether the media information comes from cache.
|
|
2808
|
+
*/
|
|
2809
|
+
fromCache: boolean;
|
|
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
|
+
}
|
|
2754
2858
|
/** {zh}
|
|
2755
2859
|
* @list Options
|
|
2756
2860
|
* @kind property
|
|
@@ -2796,12 +2900,48 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
2796
2900
|
* @default -
|
|
2797
2901
|
*/
|
|
2798
2902
|
vid?: string;
|
|
2903
|
+
/**
|
|
2904
|
+
* @brief 剧id,Minis 短剧播放需要
|
|
2905
|
+
*/
|
|
2906
|
+
albumId?: string;
|
|
2907
|
+
/**
|
|
2908
|
+
* @brief 剧集id,Minis 短剧播放需要
|
|
2909
|
+
*/
|
|
2910
|
+
episodeId?: string;
|
|
2799
2911
|
/** {zh}
|
|
2800
2912
|
* @brief Vid 播放配置项。应用服务端需通过 `vid` 生成临时临时播放 Token,下发给客户端。
|
|
2801
2913
|
* @type {IPlayAuthTokenConfig}
|
|
2802
2914
|
* @memberof IPlayerConfig
|
|
2803
2915
|
*/
|
|
2804
2916
|
getVideoByToken?: IPlayAuthTokenConfig;
|
|
2917
|
+
/** {zh}
|
|
2918
|
+
* @brief 通过 `playAuthToken` 或缓存获取到媒体信息时触发的回调。
|
|
2919
|
+
* @default -
|
|
2920
|
+
*/
|
|
2921
|
+
/** {en}
|
|
2922
|
+
* @brief Callback fired when media information is obtained from `playAuthToken` or cache.
|
|
2923
|
+
* @default -
|
|
2924
|
+
*/
|
|
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;
|
|
2935
|
+
/** {zh}
|
|
2936
|
+
* @brief 是否自动使用 `playAuthToken` 或短剧信息返回的字幕列表。
|
|
2937
|
+
* @default false
|
|
2938
|
+
*/
|
|
2939
|
+
autoSubtitle?: boolean;
|
|
2940
|
+
/** {zh}
|
|
2941
|
+
* @brief 自动字幕项格式化回调。返回字符串或数字时作为字幕名称;返回 `false` 或 `{ show: false }` 时不展示该项。
|
|
2942
|
+
* @default -
|
|
2943
|
+
*/
|
|
2944
|
+
formatAutoSubtitleItem?: IAutoSubtitleItemFormatter;
|
|
2805
2945
|
/** {zh}
|
|
2806
2946
|
* @brief 视频加密类型
|
|
2807
2947
|
* @default -
|
|
@@ -3339,6 +3479,31 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
3339
3479
|
* @default -
|
|
3340
3480
|
*/
|
|
3341
3481
|
sdkErrorPlugin?: ISdkErrorConfig;
|
|
3482
|
+
/** {zh}
|
|
3483
|
+
* @brief 原生媒体错误(如网络类 code 2/4)自动重试的最大次数,对应 {@link VeErrorOptions.oriErrRetryCount}。
|
|
3484
|
+
* @default 3
|
|
3485
|
+
*/
|
|
3486
|
+
oriErrRetryCount?: number;
|
|
3487
|
+
/** {zh}
|
|
3488
|
+
* @brief 上述重试计数的清零周期(毫秒),超时后重试次数重新统计,对应 {@link VeErrorOptions.oriErrRetryCycle}。
|
|
3489
|
+
* @default 10000
|
|
3490
|
+
*/
|
|
3491
|
+
oriErrRetryCycle?: number;
|
|
3492
|
+
/** {zh}
|
|
3493
|
+
* @brief 是否在原生媒体错误时自动重试拉流,对应 {@link VeErrorOptions.enableOriErrRetry}。
|
|
3494
|
+
* @default true
|
|
3495
|
+
*/
|
|
3496
|
+
enableOriErrRetry?: boolean;
|
|
3497
|
+
/** {zh}
|
|
3498
|
+
* @brief 是否在错误时同步分析网络/流(如 XHR 探测),对应 {@link VeErrorOptions.needSyncAnalyzeError}。
|
|
3499
|
+
* @default true
|
|
3500
|
+
*/
|
|
3501
|
+
needSyncAnalyzeError?: boolean;
|
|
3502
|
+
/** {zh}
|
|
3503
|
+
* @brief 错误分析请求超时时间(毫秒),对应 {@link VeErrorOptions.analyzeTimeout}。
|
|
3504
|
+
* @default 3000
|
|
3505
|
+
*/
|
|
3506
|
+
analyzeTimeout?: number;
|
|
3342
3507
|
/** {zh}
|
|
3343
3508
|
* @brief rtm配置,配置rtm拉流参数
|
|
3344
3509
|
* @notes 传入rtm流url时才生效
|
|
@@ -4050,83 +4215,251 @@ export interface ApiMapConfig {
|
|
|
4050
4215
|
playDomain: string;
|
|
4051
4216
|
backupPlayDomain?: string;
|
|
4052
4217
|
}
|
|
4053
|
-
|
|
4054
|
-
|
|
4218
|
+
/**
|
|
4219
|
+
* @list Options
|
|
4220
|
+
* @brief 字幕项。
|
|
4221
|
+
* @kind property
|
|
4222
|
+
*/
|
|
4223
|
+
/** {en}
|
|
4224
|
+
* @brief 字幕项配置
|
|
4225
|
+
*/
|
|
4226
|
+
export interface ISubTitleItem {
|
|
4055
4227
|
/**
|
|
4056
|
-
*
|
|
4228
|
+
* @brief 字幕语言。
|
|
4229
|
+
* @default -
|
|
4057
4230
|
*/
|
|
4058
|
-
|
|
4231
|
+
/** {en}
|
|
4232
|
+
* @brief 字幕语言
|
|
4233
|
+
*/
|
|
4234
|
+
language?: string | number;
|
|
4059
4235
|
/**
|
|
4060
|
-
*
|
|
4061
|
-
* @
|
|
4236
|
+
* @brief 字幕 ID。
|
|
4237
|
+
* @default -
|
|
4062
4238
|
*/
|
|
4063
4239
|
/** {en}
|
|
4064
|
-
* @brief
|
|
4240
|
+
* @brief 字幕id
|
|
4065
4241
|
*/
|
|
4066
|
-
|
|
4067
|
-
}
|
|
4068
|
-
declare enum StrategyNames {
|
|
4242
|
+
id?: number | string;
|
|
4069
4243
|
/**
|
|
4070
|
-
*
|
|
4071
|
-
* @
|
|
4244
|
+
* @brief 是否为默认选择的字幕。
|
|
4245
|
+
* @default false
|
|
4072
4246
|
*/
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
* 预加载
|
|
4076
|
-
* @brief 预加载策略
|
|
4247
|
+
/** {en}
|
|
4248
|
+
* @brief 是否是默认选择的字幕
|
|
4077
4249
|
*/
|
|
4078
|
-
|
|
4250
|
+
isDefault?: boolean;
|
|
4079
4251
|
/**
|
|
4080
|
-
*
|
|
4081
|
-
* @
|
|
4252
|
+
* @brief 字幕名称。
|
|
4253
|
+
* @default -
|
|
4082
4254
|
*/
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
/** {zh}
|
|
4086
|
-
* @hidden
|
|
4087
|
-
* h265策略配置
|
|
4088
|
-
* @detail Options
|
|
4089
|
-
*/
|
|
4090
|
-
export declare type IH265Config = {
|
|
4091
|
-
/**
|
|
4092
|
-
* h265策略依赖Module
|
|
4255
|
+
/** {en}
|
|
4256
|
+
* @brief 字幕名称
|
|
4093
4257
|
*/
|
|
4094
|
-
|
|
4258
|
+
text?: string;
|
|
4095
4259
|
/**
|
|
4096
|
-
*
|
|
4260
|
+
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
4261
|
+
* @default -
|
|
4097
4262
|
*/
|
|
4098
|
-
|
|
4099
|
-
} & VeStrategyH265Config;
|
|
4100
|
-
/** {zh}
|
|
4101
|
-
* 预加载初始配置
|
|
4102
|
-
* @detail Options
|
|
4103
|
-
*/
|
|
4104
|
-
export declare type IPreloadConfig = {
|
|
4105
|
-
/**
|
|
4106
|
-
* 预加载场景
|
|
4107
|
-
* @default 0
|
|
4108
|
-
* */
|
|
4109
|
-
preloadScene?: PreloadScene;
|
|
4263
|
+
label?: string | number;
|
|
4110
4264
|
/**
|
|
4111
|
-
*
|
|
4112
|
-
* @default
|
|
4113
|
-
* @brief 向前预加载视频个数。Feed 流场景时生效。
|
|
4265
|
+
* @brief 外挂字幕 URL 地址。
|
|
4266
|
+
* @default -
|
|
4114
4267
|
*/
|
|
4115
4268
|
/** {en}
|
|
4116
|
-
* @brief
|
|
4269
|
+
* @brief 外挂字幕地址
|
|
4117
4270
|
*/
|
|
4118
|
-
|
|
4271
|
+
url?: string;
|
|
4119
4272
|
/**
|
|
4120
|
-
*
|
|
4121
|
-
* @default
|
|
4122
|
-
* @
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
* @brief 向后预加载视频个数,Feed流场景生效
|
|
4273
|
+
* stringContent
|
|
4274
|
+
* @default 无
|
|
4275
|
+
* @hidden
|
|
4276
|
+
* @type {string}
|
|
4277
|
+
* @memberof ISubTitleItem
|
|
4126
4278
|
*/
|
|
4127
|
-
|
|
4279
|
+
stringContent?: string;
|
|
4128
4280
|
/**
|
|
4129
|
-
*
|
|
4281
|
+
* 字幕内容列表,非url形式时使用
|
|
4282
|
+
* @default 无
|
|
4283
|
+
* @type {Array<Object>}
|
|
4284
|
+
* @memberof ISubTitleItem
|
|
4285
|
+
* @brief 字幕内容列表。非 `url` 形式时使用。
|
|
4286
|
+
*/
|
|
4287
|
+
/** {en}
|
|
4288
|
+
* @brief 字幕内容列表,非url形式时使用
|
|
4289
|
+
*/
|
|
4290
|
+
list?: IListItem[];
|
|
4291
|
+
}
|
|
4292
|
+
/**
|
|
4293
|
+
* @brief 字幕内容项。
|
|
4294
|
+
* @list Options
|
|
4295
|
+
* @kind property
|
|
4296
|
+
* @export
|
|
4297
|
+
* @interface IListItem
|
|
4298
|
+
*/
|
|
4299
|
+
/** {en}
|
|
4300
|
+
* @brief 字幕内容项配置
|
|
4301
|
+
*/
|
|
4302
|
+
export interface IListItem {
|
|
4303
|
+
/**
|
|
4304
|
+
* 开始时间
|
|
4305
|
+
* @type {number}
|
|
4306
|
+
* @brief 开始时间,单位为秒。
|
|
4307
|
+
*/
|
|
4308
|
+
/** {en}
|
|
4309
|
+
* @brief 开始时间
|
|
4310
|
+
*/
|
|
4311
|
+
start: number;
|
|
4312
|
+
/**
|
|
4313
|
+
* 结束时间
|
|
4314
|
+
* @type {number}
|
|
4315
|
+
* @brief 结束时间,单位为秒。
|
|
4316
|
+
*/
|
|
4317
|
+
/** {en}
|
|
4318
|
+
* @brief 结束时间
|
|
4319
|
+
*/
|
|
4320
|
+
end: number;
|
|
4321
|
+
/**
|
|
4322
|
+
* 字幕数据列表
|
|
4323
|
+
* @type {Array<ITextItem>}
|
|
4324
|
+
* @brief 字幕数据列表。
|
|
4325
|
+
*/
|
|
4326
|
+
/** {en}
|
|
4327
|
+
* @brief 字幕数据列表
|
|
4328
|
+
*/
|
|
4329
|
+
list: Array<ITextItem>;
|
|
4330
|
+
/**
|
|
4331
|
+
* @default 无
|
|
4332
|
+
* @hidden
|
|
4333
|
+
* @type {any}
|
|
4334
|
+
*/
|
|
4335
|
+
[propName: string]: any;
|
|
4336
|
+
}
|
|
4337
|
+
/**
|
|
4338
|
+
* @breif 字幕文案配置
|
|
4339
|
+
* @list Options
|
|
4340
|
+
* @kind property
|
|
4341
|
+
*/
|
|
4342
|
+
export interface ITextItem {
|
|
4343
|
+
/**
|
|
4344
|
+
* @default 无
|
|
4345
|
+
* @hidden
|
|
4346
|
+
* @type {any}
|
|
4347
|
+
*/
|
|
4348
|
+
[propName: string]: any;
|
|
4349
|
+
/**
|
|
4350
|
+
* 开始时间
|
|
4351
|
+
* @type {number}
|
|
4352
|
+
* @brief 开始时间,单位为秒。
|
|
4353
|
+
*/
|
|
4354
|
+
/** {en}
|
|
4355
|
+
* @brief 开始时间
|
|
4356
|
+
*/
|
|
4357
|
+
start: number;
|
|
4358
|
+
/**
|
|
4359
|
+
* 结束时间
|
|
4360
|
+
* @type {number}
|
|
4361
|
+
* @brief 结束时间,单位为秒。
|
|
4362
|
+
*/
|
|
4363
|
+
/** {en}
|
|
4364
|
+
* @brief 结束时间
|
|
4365
|
+
*/
|
|
4366
|
+
end: number;
|
|
4367
|
+
/**
|
|
4368
|
+
* 字幕文案数组
|
|
4369
|
+
* @type {string[]}
|
|
4370
|
+
* @brief 字幕文案数组。
|
|
4371
|
+
*/
|
|
4372
|
+
/** {en}
|
|
4373
|
+
* @brief 字幕文案数组
|
|
4374
|
+
*/
|
|
4375
|
+
text: string[];
|
|
4376
|
+
/**
|
|
4377
|
+
* 字幕顺序
|
|
4378
|
+
* @type {number}
|
|
4379
|
+
* @brief 字幕顺序。
|
|
4380
|
+
*/
|
|
4381
|
+
/** {en}
|
|
4382
|
+
* @brief 字幕顺序
|
|
4383
|
+
*/
|
|
4384
|
+
index?: number;
|
|
4385
|
+
}
|
|
4386
|
+
export type TLogChannel = "cn" | "va" | "sg";
|
|
4387
|
+
declare enum PreloadScene {
|
|
4388
|
+
/**
|
|
4389
|
+
* 普通场景(手动执行预加载)
|
|
4390
|
+
*/
|
|
4391
|
+
NORMAL = 0,
|
|
4392
|
+
/**
|
|
4393
|
+
* Feed流场景(播放器自动执行预加载)
|
|
4394
|
+
* @brief Feed 流场景(播放器自动执行预加载)
|
|
4395
|
+
*/
|
|
4396
|
+
/** {en}
|
|
4397
|
+
* @brief Feed流场景(播放器自动执行预加载)
|
|
4398
|
+
*/
|
|
4399
|
+
FEED = 1
|
|
4400
|
+
}
|
|
4401
|
+
declare enum StrategyNames {
|
|
4402
|
+
/**
|
|
4403
|
+
* h265
|
|
4404
|
+
* @brief H.265 策略
|
|
4405
|
+
*/
|
|
4406
|
+
H265 = "h265",
|
|
4407
|
+
/**
|
|
4408
|
+
* 预加载
|
|
4409
|
+
* @brief 预加载策略
|
|
4410
|
+
*/
|
|
4411
|
+
PRELOAD = "preload",
|
|
4412
|
+
/**
|
|
4413
|
+
* Range拆分-动态Buffer
|
|
4414
|
+
* @brief 动态 Buffer
|
|
4415
|
+
*/
|
|
4416
|
+
ADAPT_RANGE = "adaptRange"
|
|
4417
|
+
}
|
|
4418
|
+
/** {zh}
|
|
4419
|
+
* @hidden
|
|
4420
|
+
* h265策略配置
|
|
4421
|
+
* @detail Options
|
|
4422
|
+
*/
|
|
4423
|
+
export declare type IH265Config = {
|
|
4424
|
+
/**
|
|
4425
|
+
* h265策略依赖Module
|
|
4426
|
+
*/
|
|
4427
|
+
Strategy?: any;
|
|
4428
|
+
/**
|
|
4429
|
+
* 是否禁用265策略
|
|
4430
|
+
*/
|
|
4431
|
+
disabled?: boolean;
|
|
4432
|
+
} & VeStrategyH265Config;
|
|
4433
|
+
/** {zh}
|
|
4434
|
+
* 预加载初始配置
|
|
4435
|
+
* @detail Options
|
|
4436
|
+
*/
|
|
4437
|
+
export declare type IPreloadConfig = {
|
|
4438
|
+
/**
|
|
4439
|
+
* 预加载场景
|
|
4440
|
+
* @default 0
|
|
4441
|
+
* */
|
|
4442
|
+
preloadScene?: PreloadScene;
|
|
4443
|
+
/**
|
|
4444
|
+
* 向前预加载视频个数,Feed流场景时生效
|
|
4445
|
+
* @default 1
|
|
4446
|
+
* @brief 向前预加载视频个数。Feed 流场景时生效。
|
|
4447
|
+
*/
|
|
4448
|
+
/** {en}
|
|
4449
|
+
* @brief 向前预加载视频个数,Feed流场景时生效
|
|
4450
|
+
*/
|
|
4451
|
+
prevCount?: number;
|
|
4452
|
+
/**
|
|
4453
|
+
* 向后预加载视频个数,Feed流场景生效
|
|
4454
|
+
* @default 2
|
|
4455
|
+
* @brief 向后预加载视频个数。Feed 流场景生效
|
|
4456
|
+
*/
|
|
4457
|
+
/** {en}
|
|
4458
|
+
* @brief 向后预加载视频个数,Feed流场景生效
|
|
4459
|
+
*/
|
|
4460
|
+
nextCount?: number;
|
|
4461
|
+
/**
|
|
4462
|
+
* 单个视频预加载时长
|
|
4130
4463
|
* @default 5
|
|
4131
4464
|
*/
|
|
4132
4465
|
preloadTime?: number;
|
|
@@ -4311,7 +4644,7 @@ export declare type IPreloadUpdateConfig = {
|
|
|
4311
4644
|
* 预加载视频资源
|
|
4312
4645
|
* @detail Options
|
|
4313
4646
|
*/
|
|
4314
|
-
export declare type
|
|
4647
|
+
export declare type IPreloadResolvedStream = {
|
|
4315
4648
|
/**
|
|
4316
4649
|
* 视频唯一ID
|
|
4317
4650
|
* @brief 视频 ID
|
|
@@ -4373,6 +4706,43 @@ export declare type IPreloadStream = {
|
|
|
4373
4706
|
*/
|
|
4374
4707
|
size: number;
|
|
4375
4708
|
};
|
|
4709
|
+
export declare type IPreloadDramaStream = {
|
|
4710
|
+
/**
|
|
4711
|
+
* 视频唯一ID
|
|
4712
|
+
*/
|
|
4713
|
+
vid?: string;
|
|
4714
|
+
/**
|
|
4715
|
+
* 短剧剧 ID
|
|
4716
|
+
*/
|
|
4717
|
+
albumId: string;
|
|
4718
|
+
/**
|
|
4719
|
+
* 短剧剧集 ID
|
|
4720
|
+
*/
|
|
4721
|
+
episodeId: string;
|
|
4722
|
+
/**
|
|
4723
|
+
* 默认清晰度,用于缓存 key 和预加载流选择
|
|
4724
|
+
*/
|
|
4725
|
+
defaultDefinition?: string;
|
|
4726
|
+
/**
|
|
4727
|
+
* Vid 播放配置。短剧预加载会复用 playAuthToken 等配置请求短剧信息。
|
|
4728
|
+
*/
|
|
4729
|
+
getVideoByToken?: IPlayAuthTokenConfig;
|
|
4730
|
+
};
|
|
4731
|
+
export declare type IPreloadAuthTokenStream = {
|
|
4732
|
+
/**
|
|
4733
|
+
* 视频唯一ID
|
|
4734
|
+
*/
|
|
4735
|
+
vid?: string;
|
|
4736
|
+
/**
|
|
4737
|
+
* 默认清晰度,用于选择预加载流
|
|
4738
|
+
*/
|
|
4739
|
+
defaultDefinition?: string;
|
|
4740
|
+
/**
|
|
4741
|
+
* Vid 播放配置。预加载会复用 playAuthToken 请求媒体信息。
|
|
4742
|
+
*/
|
|
4743
|
+
getVideoByToken: IPlayAuthTokenConfig;
|
|
4744
|
+
};
|
|
4745
|
+
export declare type IPreloadStream = IPreloadResolvedStream | IPreloadDramaStream | IPreloadAuthTokenStream;
|
|
4376
4746
|
declare class VeStrategyWrapper {
|
|
4377
4747
|
private tea;
|
|
4378
4748
|
private static mapStrategyNameToUmdKey;
|
|
@@ -4451,6 +4821,8 @@ export declare type UMDMap = Record<UmdKeys, {
|
|
|
4451
4821
|
declare class UMDLoader {
|
|
4452
4822
|
private static jsLoadMap;
|
|
4453
4823
|
private static jsLoadPromiseMap;
|
|
4824
|
+
/** 清除指定插件的加载缓存,使下次 loadPlugins 重新触发加载(用于修复首次加载失败的情况) */
|
|
4825
|
+
clearPluginCache(pluginName: UmdKeys): void;
|
|
4454
4826
|
umdMap: UMDMap;
|
|
4455
4827
|
backupUmdUrlMap: Record<string, string>;
|
|
4456
4828
|
failCallback: (umdName: string, err: any) => any;
|
|
@@ -4532,6 +4904,129 @@ export declare class SdkPlugin {
|
|
|
4532
4904
|
*/
|
|
4533
4905
|
__destroy(): void;
|
|
4534
4906
|
}
|
|
4907
|
+
/**
|
|
4908
|
+
* @author bytedance
|
|
4909
|
+
* @version 1.0
|
|
4910
|
+
* @Description
|
|
4911
|
+
* @date 2024/12/16 17:59
|
|
4912
|
+
*/
|
|
4913
|
+
export declare const enum LangTextKey {
|
|
4914
|
+
NETWORK = "NETWORK",
|
|
4915
|
+
NETWORK_TIMEOUT = "NETWORK_TIMEOUT",
|
|
4916
|
+
NETWORK_FORBIDDEN = "NETWORK_FORBIDDEN",
|
|
4917
|
+
NETWORK_NOTFOUND = "NETWORK_NOTFOUND",
|
|
4918
|
+
NETWORK_RANGE_NOT_SATISFIABLE = "NETWORK_RANGE_NOT_SATISFIABLE",
|
|
4919
|
+
NETWORK_PROTOCOL = "NETWORK_PROTOCOL",
|
|
4920
|
+
NETWORK_URL_EXPIRE = "NETWORK_URL_EXPIRE",
|
|
4921
|
+
NETWORK_URL_SIGN = "NETWORK_URL_SIGN",
|
|
4922
|
+
NETWORK_ENCRYPT_HLS_ERR = "NETWORK_ENCRYPT_HLS_ERR",
|
|
4923
|
+
MEDIA_ERR = "MEDIA_ERR",
|
|
4924
|
+
MEDIA_ERR_ABORTED = "MEDIA_ERR_ABORTED",
|
|
4925
|
+
MEDIA_ERR_NETWORK = "MEDIA_ERR_NETWORK",
|
|
4926
|
+
MEDIA_ERR_DECODE = "MEDIA_ERR_DECODE",
|
|
4927
|
+
MEDIA_ERR_SRC_NOT_SUPPORTED = "MEDIA_ERR_SRC_NOT_SUPPORTED",
|
|
4928
|
+
MEDIA_ERR_NOT_SUPPORTED = "MEDIA_ERR_NOT_SUPPORTED",
|
|
4929
|
+
MEDIA_ERR_URL_EMPTY = "MEDIA_ERR_URL_EMPTY",
|
|
4930
|
+
MEDIA_ERR_FILE_NOT_SUPPORTED = "MEDIA_ERR_FILE_NOT_SUPPORTED",
|
|
4931
|
+
MEDIA_ERR_PLAY_ERR = "MEDIA_ERR_PLAY_ERR",
|
|
4932
|
+
MEDIA_SOURCE_CANNOT_PLAY_TYPE = "MEDIA_SOURCE_CANNOT_PLAY_TYPE",
|
|
4933
|
+
BUSINESS_DRM_NOT_SUPPORT = "BUSINESS_DRM_NOT_SUPPORT",
|
|
4934
|
+
BUSINESS_DRM_NOT_SUPPORT_UN_RECORD = "BUSINESS_DRM_NOT_SUPPORT_UN_RECORD",
|
|
4935
|
+
BUSINESS_DRM_LACK_MEDIA_KEY = "BUSINESS_DRM_LACK_MEDIA_KEY",
|
|
4936
|
+
BUSINESS_DRM_LACK_KEY_SESSION = "BUSINESS_DRM_LACK_KEY_SESSION",
|
|
4937
|
+
BUSINESS_DRM_GENERATE_REQUEST_FAIL = "BUSINESS_DRM_GENERATE_REQUEST_FAIL",
|
|
4938
|
+
BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH = "BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH",
|
|
4939
|
+
BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH = "BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH",
|
|
4940
|
+
BUSINESS_DRM_LICENSE_FAIL = "BUSINESS_DRM_LICENSE_FAIL",
|
|
4941
|
+
BUSINESS_DRM_KEY_ERROR = "BUSINESS_DRM_KEY_ERROR",
|
|
4942
|
+
BUSINESS_DRM_CERT_FAIL = "BUSINESS_DRM_CERT_FAIL",
|
|
4943
|
+
PRIVATE_DRM_KEY_GET_FAILED = "PRIVATE_DRM_KEY_GET_FAILED",
|
|
4944
|
+
PRIVATE_DRM_CRYPTO_NOT_SUPPORT = "PRIVATE_DRM_CRYPTO_NOT_SUPPORT",
|
|
4945
|
+
PRIVATE_DRM_RSA_FAIL = "PRIVATE_DRM_RSA_FAIL",
|
|
4946
|
+
OTHER = "OTHER",
|
|
4947
|
+
VOD_LOG_NOT_CONFIGURED = "VOD_LOG_NOT_CONFIGURED",
|
|
4948
|
+
PLAY_AUTH_TOKEN_EXPIRED = "PLAY_AUTH_TOKEN_EXPIRED",
|
|
4949
|
+
HLS_KEY_TOKEN_EXPIRED = "HLS_KEY_TOKEN_EXPIRED",
|
|
4950
|
+
THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED = "THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED",
|
|
4951
|
+
GET_PLAY_INFO_ERR = "GET_PLAY_INFO_ERR",
|
|
4952
|
+
GET_HLS_DECRYPTION_KEY_ERR = "GET_HLS_DECRYPTION_KEY_ERR",
|
|
4953
|
+
LICENSE_VALIDATE_FAIL = "LICENSE_VALIDATE_FAIL",
|
|
4954
|
+
DEFINITION_AUTO = "DEFINITION_AUTO",
|
|
4955
|
+
LICENSE_STATUS_INVALID = "LICENSE_STATUS_INVALID",
|
|
4956
|
+
LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH = "LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH",
|
|
4957
|
+
BASE_LICENSE_NOT_SUPPORT_265 = "BASE_LICENSE_NOT_SUPPORT_265",
|
|
4958
|
+
BASE_LICENSE_NOT_SUPPORT_ABR = "BASE_LICENSE_NOT_SUPPORT_ABR",
|
|
4959
|
+
BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER = "BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",
|
|
4960
|
+
BASE_LICENSE_NOT_SUPPORT_PRELOAD = "BASE_LICENSE_NOT_SUPPORT_PRELOAD",
|
|
4961
|
+
EXPIRED_LICENSE_NOT_SUPPORT_265 = "EXPIRED_LICENSE_NOT_SUPPORT_265",
|
|
4962
|
+
EXPIRED_LICENSE_NOT_SUPPORT_ABR = "EXPIRED_LICENSE_NOT_SUPPORT_ABR",
|
|
4963
|
+
EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER = "EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",
|
|
4964
|
+
EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD = "EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD",
|
|
4965
|
+
/** Short drama (Minis) errors — codes 93xx */
|
|
4966
|
+
DRAMA_INVALID_PARAM = "DRAMA_INVALID_PARAM",
|
|
4967
|
+
DRAMA_NO_INFO_FOUND = "DRAMA_NO_INFO_FOUND",
|
|
4968
|
+
DRAMA_NOT_SUBMITTED = "DRAMA_NOT_SUBMITTED",
|
|
4969
|
+
DRAMA_UNDER_REVIEW = "DRAMA_UNDER_REVIEW",
|
|
4970
|
+
DRAMA_FAILED_REVIEW = "DRAMA_FAILED_REVIEW",
|
|
4971
|
+
DRAMA_WITHDRAWN_REVIEW = "DRAMA_WITHDRAWN_REVIEW",
|
|
4972
|
+
DRAMA_FAILED_TO_QUERY = "DRAMA_FAILED_TO_QUERY",
|
|
4973
|
+
DRAMA_INVALID_TTOP_TOKEN = "DRAMA_INVALID_TTOP_TOKEN",
|
|
4974
|
+
DRAMA_NOT_ON_SHELF = "DRAMA_NOT_ON_SHELF",
|
|
4975
|
+
DRAMA_FAILED_GET_EPISODE_INFO = "DRAMA_FAILED_GET_EPISODE_INFO"
|
|
4976
|
+
}
|
|
4977
|
+
declare const DRAMA_ERROR_CODE: {
|
|
4978
|
+
/** 9301 - 短剧环境下参数不合法(如使用 url/playList 播放,或缺少 albumId / episodeId) */
|
|
4979
|
+
readonly INVALID_PARAM: {
|
|
4980
|
+
readonly code: 9301;
|
|
4981
|
+
readonly message: "Invalid parameter in short drama environment";
|
|
4982
|
+
readonly textKey: LangTextKey.DRAMA_INVALID_PARAM;
|
|
4983
|
+
};
|
|
4984
|
+
readonly NO_INFO_FOUND: {
|
|
4985
|
+
readonly code: 9302;
|
|
4986
|
+
readonly message: "No information found for this Episode";
|
|
4987
|
+
readonly textKey: LangTextKey.DRAMA_NO_INFO_FOUND;
|
|
4988
|
+
};
|
|
4989
|
+
readonly NOT_SUBMITTED: {
|
|
4990
|
+
readonly code: 9303;
|
|
4991
|
+
readonly message: "Episode not submitted for review";
|
|
4992
|
+
readonly textKey: LangTextKey.DRAMA_NOT_SUBMITTED;
|
|
4993
|
+
};
|
|
4994
|
+
readonly UNDER_REVIEW: {
|
|
4995
|
+
readonly code: 9304;
|
|
4996
|
+
readonly message: "Episode under for review";
|
|
4997
|
+
readonly textKey: LangTextKey.DRAMA_UNDER_REVIEW;
|
|
4998
|
+
};
|
|
4999
|
+
readonly FAILED_REVIEW: {
|
|
5000
|
+
readonly code: 9305;
|
|
5001
|
+
readonly message: "Episode failed review";
|
|
5002
|
+
readonly textKey: LangTextKey.DRAMA_FAILED_REVIEW;
|
|
5003
|
+
};
|
|
5004
|
+
readonly WITHDRAWN_REVIEW: {
|
|
5005
|
+
readonly code: 9306;
|
|
5006
|
+
readonly message: "Episode withdrawn from review";
|
|
5007
|
+
readonly textKey: LangTextKey.DRAMA_WITHDRAWN_REVIEW;
|
|
5008
|
+
};
|
|
5009
|
+
readonly FAILED_TO_QUERY: {
|
|
5010
|
+
readonly code: 9307;
|
|
5011
|
+
readonly message: "Failed to query video playback information";
|
|
5012
|
+
readonly textKey: LangTextKey.DRAMA_FAILED_TO_QUERY;
|
|
5013
|
+
};
|
|
5014
|
+
readonly INVALID_TTOP_TOKEN: {
|
|
5015
|
+
readonly code: 9308;
|
|
5016
|
+
readonly message: "Invalid playAuthToken or failed to verify TTOP token";
|
|
5017
|
+
readonly textKey: LangTextKey.DRAMA_INVALID_TTOP_TOKEN;
|
|
5018
|
+
};
|
|
5019
|
+
readonly NOT_ON_SHELF: {
|
|
5020
|
+
readonly code: 9310;
|
|
5021
|
+
readonly message: "Video is not on shelf";
|
|
5022
|
+
readonly textKey: LangTextKey.DRAMA_NOT_ON_SHELF;
|
|
5023
|
+
};
|
|
5024
|
+
readonly FAILED_GET_EPISODE_INFO: {
|
|
5025
|
+
readonly code: 9399;
|
|
5026
|
+
readonly message: "Failed get episode info";
|
|
5027
|
+
readonly textKey: LangTextKey.DRAMA_FAILED_GET_EPISODE_INFO;
|
|
5028
|
+
};
|
|
5029
|
+
};
|
|
4535
5030
|
declare class AuthToken extends SdkPlugin {
|
|
4536
5031
|
static get pluginName(): string;
|
|
4537
5032
|
isPlayByToken: boolean;
|
|
@@ -4553,13 +5048,50 @@ declare class AuthToken extends SdkPlugin {
|
|
|
4553
5048
|
codec: ICodecType;
|
|
4554
5049
|
defaultDefinition: string;
|
|
4555
5050
|
}>;
|
|
5051
|
+
/**
|
|
5052
|
+
* 短剧 Minis 环境:通过 JSB getDramaInfo 获取媒体信息
|
|
5053
|
+
*/
|
|
5054
|
+
getDramaInfoViaJSB(): Promise<VideoInfoRes | undefined>;
|
|
5055
|
+
/**
|
|
5056
|
+
* 将审核状态映射到短剧错误码
|
|
5057
|
+
*/
|
|
5058
|
+
mapReviewStatusToErrorCode(status: number): keyof typeof DRAMA_ERROR_CODE;
|
|
5059
|
+
/**
|
|
5060
|
+
* 根据 JSB 返回的 msg 或 status 映射到错误码 key
|
|
5061
|
+
*/
|
|
5062
|
+
mapDramaErrorCode(msg: string, status?: number): keyof typeof DRAMA_ERROR_CODE;
|
|
5063
|
+
/**
|
|
5064
|
+
* 将 JSB 返回的 video_info 转换为 VideoInfoRes 格式
|
|
5065
|
+
*/
|
|
5066
|
+
transformDramaVideoInfoToRes(videoInfo: any, config: IPlayAuthTokenConfig): VideoInfoRes;
|
|
5067
|
+
callOnGetMediaInfo(mediaInfo: VideoInfoRes | undefined, fromCache: boolean): void;
|
|
5068
|
+
reportGetDramaInfoPerf(res: IJSBCallbackResult | undefined, request: {
|
|
5069
|
+
albumId?: string;
|
|
5070
|
+
episodeId?: string;
|
|
5071
|
+
vid?: string;
|
|
5072
|
+
}): void;
|
|
4556
5073
|
getVideos(): Promise<any>;
|
|
4557
5074
|
getPrivateDrmInfo(playList: Stream[], vid: string, streamType: string): Promise<void>;
|
|
4558
5075
|
getThumbnailConfig(thumbs: IThumbInfoItem[]): void;
|
|
4559
5076
|
getBarrageMaskUrl(url: string): void;
|
|
5077
|
+
setSubtitleConfig(mediaInfo: VideoInfoRes | undefined): void;
|
|
5078
|
+
getAutoSubtitleList(mediaInfo: VideoInfoRes): ISubTitleItem[];
|
|
5079
|
+
getSubtitleSourceData(mediaInfo: VideoInfoRes): any;
|
|
5080
|
+
getAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
|
|
5081
|
+
getStringAutoSubtitleItem(item: string, index: number): ISubTitleItem;
|
|
5082
|
+
getObjectAutoSubtitleItem(item: any, index: number): ISubTitleItem | undefined;
|
|
5083
|
+
formatAutoSubtitleItem(subtitleItem: ISubTitleItem, rawItem: any, index: number): ISubTitleItem | undefined;
|
|
4560
5084
|
getDrmConfig(videoInfo: IVideoInfo): void;
|
|
5085
|
+
/**
|
|
5086
|
+
* 是否处于短剧 Minis 环境(通过剧 ID + 剧集 ID 获取视频)
|
|
5087
|
+
*/
|
|
5088
|
+
get isMinisDramaMode(): boolean;
|
|
4561
5089
|
init(): void;
|
|
4562
5090
|
initConfig(getVideoByToken: IPlayAuthTokenConfig): void;
|
|
5091
|
+
/**
|
|
5092
|
+
* 剧集切换:configs 已由 player 更新 album_id/episode_id,重新拉取媒体信息
|
|
5093
|
+
*/
|
|
5094
|
+
updateDramaEpisode(isNewVideo: boolean): Promise<void>;
|
|
4563
5095
|
/**
|
|
4564
5096
|
* @description 更新playAuthToken
|
|
4565
5097
|
* @param {IPlayAuthTokenConfig} getVideoByToken token信息
|
|
@@ -4679,9 +5211,7 @@ declare class PlayerData {
|
|
|
4679
5211
|
* @brief 私有加密会话id
|
|
4680
5212
|
*/
|
|
4681
5213
|
encryptSessionId?: string;
|
|
4682
|
-
constructor(configs: IPlayerConfig
|
|
4683
|
-
licensSupportModuleList: string[];
|
|
4684
|
-
}, sdk: VePlayer);
|
|
5214
|
+
constructor(configs: IPlayerConfig, sdk: VePlayer);
|
|
4685
5215
|
/**
|
|
4686
5216
|
* 初始化播放数据
|
|
4687
5217
|
* @param configs { IPlayerConfig } 播放器配置
|
|
@@ -4726,7 +5256,6 @@ declare class PlayerData {
|
|
|
4726
5256
|
* @description: 获取满足当前直播条件的流
|
|
4727
5257
|
*/
|
|
4728
5258
|
getCurrentStreams(): Stream[];
|
|
4729
|
-
getStreamsMatchCurrentDefinition(): Stream[];
|
|
4730
5259
|
/**
|
|
4731
5260
|
* @description: 获取根据线路ID去重的流,用于获取有几个线路
|
|
4732
5261
|
*/
|
|
@@ -4809,34 +5338,62 @@ declare class MobilePlayerPanel {
|
|
|
4809
5338
|
bind(event: string, eventHandle: any, isBubble?: boolean): void;
|
|
4810
5339
|
destroy(): void;
|
|
4811
5340
|
}
|
|
4812
|
-
export
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
}
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
5341
|
+
export declare type MediaInfoCacheType = "memory" | "localStorage";
|
|
5342
|
+
/** {zh}
|
|
5343
|
+
* @brief 媒体信息本地缓存配置。
|
|
5344
|
+
* @list Options
|
|
5345
|
+
* @kind property
|
|
5346
|
+
*/
|
|
5347
|
+
/** {en}
|
|
5348
|
+
* @brief Local media info cache config.
|
|
5349
|
+
* @list Options
|
|
5350
|
+
* @kind property
|
|
5351
|
+
*/
|
|
5352
|
+
export interface MediaInfoCacheConfig {
|
|
5353
|
+
/** {zh}
|
|
5354
|
+
* @brief 是否启用媒体信息本地缓存。默认关闭。
|
|
5355
|
+
* @default false
|
|
5356
|
+
*/
|
|
5357
|
+
/** {en}
|
|
5358
|
+
* @brief Whether to enable local media info cache. Disabled by default.
|
|
5359
|
+
* @default false
|
|
5360
|
+
*/
|
|
5361
|
+
enable?: boolean;
|
|
5362
|
+
/** {zh}
|
|
5363
|
+
* @brief 缓存方式。默认使用内存缓存,设置为 localStorage 时写入浏览器本地存储。
|
|
5364
|
+
* @default memory
|
|
5365
|
+
*/
|
|
5366
|
+
/** {en}
|
|
5367
|
+
* @brief Cache storage type. Memory cache is used by default. Set to localStorage to write browser local storage.
|
|
5368
|
+
* @default memory
|
|
5369
|
+
*/
|
|
5370
|
+
cacheType?: MediaInfoCacheType;
|
|
5371
|
+
/** {zh}
|
|
5372
|
+
* @brief 缓存过期时间,单位毫秒。默认 30 分钟。
|
|
5373
|
+
* @default 1800000
|
|
5374
|
+
*/
|
|
5375
|
+
/** {en}
|
|
5376
|
+
* @brief Cache expiration time in milliseconds. Defaults to 30 minutes.
|
|
5377
|
+
* @default 1800000
|
|
5378
|
+
*/
|
|
5379
|
+
expireTime?: number;
|
|
5380
|
+
/** {zh}
|
|
5381
|
+
* @brief 最多缓存的媒体信息条数,默认 100。
|
|
5382
|
+
* @default 100
|
|
5383
|
+
*/
|
|
5384
|
+
/** {en}
|
|
5385
|
+
* @brief Maximum number of media info entries to cache. Defaults to 100.
|
|
5386
|
+
* @default 100
|
|
5387
|
+
*/
|
|
5388
|
+
maxEntries?: number;
|
|
4839
5389
|
}
|
|
5390
|
+
export declare type NormalizedMediaInfoCacheConfig = {
|
|
5391
|
+
enable: boolean;
|
|
5392
|
+
expireTime: number;
|
|
5393
|
+
cacheType: MediaInfoCacheType;
|
|
5394
|
+
maxEntries: number;
|
|
5395
|
+
};
|
|
5396
|
+
declare function getMediaInfoCacheConfig(): NormalizedMediaInfoCacheConfig;
|
|
4840
5397
|
/** {zh}
|
|
4841
5398
|
* @hidden
|
|
4842
5399
|
*/
|
|
@@ -4852,10 +5409,6 @@ export declare type PlayerCore = Player & {
|
|
|
4852
5409
|
panel?: MobilePlayerPanel;
|
|
4853
5410
|
emitExpireTimestamp?: number;
|
|
4854
5411
|
vodLogger?: VodLogger;
|
|
4855
|
-
licenseLogInfo?: {
|
|
4856
|
-
licenseStatus: LicenseStatus;
|
|
4857
|
-
licenseType: LicenseEdition;
|
|
4858
|
-
};
|
|
4859
5412
|
};
|
|
4860
5413
|
/**
|
|
4861
5414
|
* @brief 加密混淆信息
|
|
@@ -4928,6 +5481,18 @@ declare class VePlayer {
|
|
|
4928
5481
|
* @memberof VePlayer
|
|
4929
5482
|
*/
|
|
4930
5483
|
private _emitter;
|
|
5484
|
+
/**
|
|
5485
|
+
* @hidden
|
|
5486
|
+
* createPlayer 阶段耗时采集器(仅在 createPlayer 执行期间存在)
|
|
5487
|
+
*/
|
|
5488
|
+
_createPlayerPerf?: CreatePlayerPerfCollector;
|
|
5489
|
+
/**
|
|
5490
|
+
* @hidden
|
|
5491
|
+
* 最近一次 createPlayer 性能报告
|
|
5492
|
+
*/
|
|
5493
|
+
private _lastCreatePlayerPerfReport?;
|
|
5494
|
+
private _isCollectingCreatePlayerPerf;
|
|
5495
|
+
private _getDramaInfoPerfRecords;
|
|
4931
5496
|
/**
|
|
4932
5497
|
*
|
|
4933
5498
|
*
|
|
@@ -4970,6 +5535,22 @@ declare class VePlayer {
|
|
|
4970
5535
|
* @memberof VePlayer
|
|
4971
5536
|
*/
|
|
4972
5537
|
delayError: any[];
|
|
5538
|
+
/** {zh}
|
|
5539
|
+
* @brief 设置是否为通过短剧信息或 playAuthToken 获取到的视频地址追加时间戳 query(t=Date.now())。
|
|
5540
|
+
* @param enable true=追加时间戳,false=不追加
|
|
5541
|
+
*/
|
|
5542
|
+
/** {en}
|
|
5543
|
+
* @brief Set whether to append a timestamp query (t=Date.now()) to video URLs from drama info or playAuthToken.
|
|
5544
|
+
* @param enable true=append timestamp, false=do not append
|
|
5545
|
+
*/
|
|
5546
|
+
static setAppendVideoUrlTimestamp(enable?: boolean): void;
|
|
5547
|
+
/** {zh}
|
|
5548
|
+
* @hidden
|
|
5549
|
+
*/
|
|
5550
|
+
/** {en}
|
|
5551
|
+
* @hidden
|
|
5552
|
+
*/
|
|
5553
|
+
static getAppendVideoUrlTimestamp(): boolean;
|
|
4973
5554
|
/**
|
|
4974
5555
|
* @hidden
|
|
4975
5556
|
* umd加载器
|
|
@@ -4985,7 +5566,6 @@ declare class VePlayer {
|
|
|
4985
5566
|
/**
|
|
4986
5567
|
* @hidden
|
|
4987
5568
|
*/
|
|
4988
|
-
static isRTMSupported: typeof import("@byted/xgplayer-rts").RtsPlugin.isSupported;
|
|
4989
5569
|
/**
|
|
4990
5570
|
* @hidden
|
|
4991
5571
|
*/
|
|
@@ -4996,6 +5576,51 @@ declare class VePlayer {
|
|
|
4996
5576
|
* @memberof VePlayer
|
|
4997
5577
|
*/
|
|
4998
5578
|
static sdkVersion: string;
|
|
5579
|
+
/**
|
|
5580
|
+
* @brief TT短剧环境配置
|
|
5581
|
+
* @type {ITTDramaEnv | null}
|
|
5582
|
+
* @memberof VePlayer
|
|
5583
|
+
*/
|
|
5584
|
+
static ttDramaEnv: ITTDramaEnv | null;
|
|
5585
|
+
/** {zh}
|
|
5586
|
+
* @brief 设置TT短剧播放环境
|
|
5587
|
+
* @param env 短剧环境配置,详情见{@link ITTDramaEnv}
|
|
5588
|
+
*/
|
|
5589
|
+
static setTTDramaEnv(env: ITTDramaEnv): void;
|
|
5590
|
+
/** {zh}
|
|
5591
|
+
* @brief 设置媒体信息本地缓存配置,默认关闭。开启后,通过短剧信息或 playAuthToken 获取媒体信息时优先使用缓存。
|
|
5592
|
+
* @param config 缓存配置
|
|
5593
|
+
*/
|
|
5594
|
+
/** {en}
|
|
5595
|
+
* @brief Set the local media info cache config. It is disabled by default. When enabled, media info from drama info or playAuthToken prefers cached data.
|
|
5596
|
+
* @param config Cache config
|
|
5597
|
+
*/
|
|
5598
|
+
static setMediaInfoCacheConfig(config: MediaInfoCacheConfig): void;
|
|
5599
|
+
/** {zh}
|
|
5600
|
+
* @brief 获取当前媒体信息本地缓存配置。
|
|
5601
|
+
* @returns 当前媒体信息缓存配置。
|
|
5602
|
+
*/
|
|
5603
|
+
/** {en}
|
|
5604
|
+
* @brief Get current local media info cache config.
|
|
5605
|
+
* @returns Current media info cache config.
|
|
5606
|
+
*/
|
|
5607
|
+
static getMediaInfoCacheConfig(): ReturnType<typeof getMediaInfoCacheConfig>;
|
|
5608
|
+
/** {zh}
|
|
5609
|
+
* @brief 清除媒体信息缓存,会同时清除内存缓存和 localStorage 缓存。
|
|
5610
|
+
*/
|
|
5611
|
+
/** {en}
|
|
5612
|
+
* @brief Clear media info cache from both memory cache and localStorage cache.
|
|
5613
|
+
*/
|
|
5614
|
+
static clearMediaInfoCache(): void;
|
|
5615
|
+
/** {zh}
|
|
5616
|
+
* @brief 设置全局日志开关。开启后会输出 VE_DEBUG.log 级别日志。
|
|
5617
|
+
* @param enable 是否开启详细日志
|
|
5618
|
+
*/
|
|
5619
|
+
/** {en}
|
|
5620
|
+
* @brief Set the global log switch. When enabled, VE_DEBUG.log level logs are printed.
|
|
5621
|
+
* @param enable Whether to enable verbose logs
|
|
5622
|
+
*/
|
|
5623
|
+
static setDebug(enable: boolean): void;
|
|
4999
5624
|
/**
|
|
5000
5625
|
* @hidden
|
|
5001
5626
|
*/
|
|
@@ -5028,7 +5653,7 @@ declare class VePlayer {
|
|
|
5028
5653
|
* @brief 添加待预加载视频列表
|
|
5029
5654
|
* @param list 待预加载视频列表,详情见{@link IPreloadStream[]}。
|
|
5030
5655
|
*/
|
|
5031
|
-
static addPreloadList(list: IPreloadStream[]): void
|
|
5656
|
+
static addPreloadList(list: IPreloadStream[]): Promise<void>;
|
|
5032
5657
|
/** {zh}
|
|
5033
5658
|
* @brief 设置待预加载视频列表,替换当前已设置的待预加载列表
|
|
5034
5659
|
* @param list 待预加载视频列表,详情见{@link IPreloadStream[]}
|
|
@@ -5039,14 +5664,6 @@ declare class VePlayer {
|
|
|
5039
5664
|
* @param codec
|
|
5040
5665
|
* @param options
|
|
5041
5666
|
*/
|
|
5042
|
-
static isRTMSupportCodec: (codec: RTMCodec, options: {
|
|
5043
|
-
targetProfileLevel?: string;
|
|
5044
|
-
}) => Promise<boolean>;
|
|
5045
|
-
static setLicenseConfig(config: ILicenseConfig): Promise<void>;
|
|
5046
|
-
static checkLicense(): Promise<LicenseEdition>;
|
|
5047
|
-
static checkModuleList(): Promise<string[]>;
|
|
5048
|
-
static checkLicenseStatus(): Promise<LicenseStatus>;
|
|
5049
|
-
static checkLicenseModuleAuth(module: string, featureName: LicenseFeature): Promise<boolean>;
|
|
5050
5667
|
/**
|
|
5051
5668
|
* @breif 生成加密混淆的数据信息
|
|
5052
5669
|
* @param unionId 用户唯一id
|
|
@@ -5194,7 +5811,6 @@ declare class VePlayer {
|
|
|
5194
5811
|
* @hidden
|
|
5195
5812
|
*/
|
|
5196
5813
|
createPlayer: () => Promise<PlayerCore>;
|
|
5197
|
-
private checkLicenseCallback;
|
|
5198
5814
|
/** {zh}
|
|
5199
5815
|
* @hidden
|
|
5200
5816
|
* @brief 设置合并开发者的插件配置,如果开发者从初始化的configs里传了插件配置,则只用开发者的配置,并补齐其他参数
|
|
@@ -5260,6 +5876,28 @@ declare class VePlayer {
|
|
|
5260
5876
|
* @memberof VePlayer
|
|
5261
5877
|
*/
|
|
5262
5878
|
beforePlayerCreate(): Promise<void>;
|
|
5879
|
+
/** {zh}
|
|
5880
|
+
* @hidden
|
|
5881
|
+
* @brief 获取最近一次 createPlayer 的性能报告。
|
|
5882
|
+
*/
|
|
5883
|
+
/** {en}
|
|
5884
|
+
* @hidden
|
|
5885
|
+
* @brief Get the perf report of the latest createPlayer.
|
|
5886
|
+
*/
|
|
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;
|
|
5263
5901
|
private prepareStrategies;
|
|
5264
5902
|
/**
|
|
5265
5903
|
* @hidden
|
|
@@ -5306,6 +5944,7 @@ declare class VePlayer {
|
|
|
5306
5944
|
* @memberof VePlayer
|
|
5307
5945
|
*/
|
|
5308
5946
|
private _bindPlayerEvents;
|
|
5947
|
+
private _onMp4PreloadInfo;
|
|
5309
5948
|
private _proxyError;
|
|
5310
5949
|
private _onError;
|
|
5311
5950
|
/** {zh}
|
|
@@ -5423,8 +6062,35 @@ declare class VePlayer {
|
|
|
5423
6062
|
* @param config 播放器实例化配置。此接口仅支持 `IPlayerConfig` 中的 `url`、`playList`、`poster`、`getVideoByToken` 字段。。
|
|
5424
6063
|
* @param isNewVideo 是否为新视频。为 `false` 时,更换后,会从更换前的时间点继续播放。
|
|
5425
6064
|
*/
|
|
6065
|
+
/** {zh}
|
|
6066
|
+
* @brief 当前播放器命中预加载的情况
|
|
6067
|
+
* @type {{
|
|
6068
|
+
* hit: number, // 0-未命中 1-命中
|
|
6069
|
+
* duration: 0, // 预加载时长
|
|
6070
|
+
* length: 0 // 预加载数据长度
|
|
6071
|
+
* }}
|
|
6072
|
+
*/
|
|
6073
|
+
/** {en}
|
|
6074
|
+
* @brief Whether the current playback hit preloaded data.
|
|
6075
|
+
* @type {{
|
|
6076
|
+
* hit: number, // 0-miss 1-hit
|
|
6077
|
+
* duration: number, // preloaded duration
|
|
6078
|
+
* length: number // preloaded data length in bytes
|
|
6079
|
+
* }}
|
|
6080
|
+
*/
|
|
6081
|
+
get preLoadData(): {
|
|
6082
|
+
hit: number;
|
|
6083
|
+
duration?: number;
|
|
6084
|
+
length?: number;
|
|
6085
|
+
};
|
|
5426
6086
|
playNext(config: IPlayerConfig, isNewVideo?: boolean): Promise<any>;
|
|
5427
6087
|
private _playNext;
|
|
6088
|
+
/** 从 playerData.configs 取出短剧 id,供 XGPlayer setConfig / playNext 与切换后 configs 一致 */
|
|
6089
|
+
private _getDramaConfigPatchForPlayer;
|
|
6090
|
+
private _buildDramaInvalidParamError;
|
|
6091
|
+
private _getDramaAlbumIdFromConfig;
|
|
6092
|
+
private _getDramaEpisodeIdFromConfig;
|
|
6093
|
+
private switchDramaEpisode;
|
|
5428
6094
|
/** {zh}
|
|
5429
6095
|
* @brief 销毁xgplayer实例
|
|
5430
6096
|
*
|
|
@@ -5625,6 +6291,32 @@ declare class VePlayer {
|
|
|
5625
6291
|
* @param pluginName 插件名。
|
|
5626
6292
|
*/
|
|
5627
6293
|
getPlugin(pluginName: string): null | BasePlugin;
|
|
6294
|
+
/** {zh}
|
|
6295
|
+
* @brief 获取字幕列表。需配置 `Subtitle` 插件后调用。
|
|
6296
|
+
* @return 当前字幕列表,每项包含 `id`、`language`、`text`(显示名称)等字段。列表为空时返回空数组。
|
|
6297
|
+
* @memberof VePlayer
|
|
6298
|
+
*/
|
|
6299
|
+
getSubtitleList(): ISubTitleItem[];
|
|
6300
|
+
/** {zh}
|
|
6301
|
+
* @brief 切换字幕。需配置 `Subtitle` 插件后调用。
|
|
6302
|
+
* @param subtitle 目标字幕的 id 或 language,任意一个非空即可定位字幕项。
|
|
6303
|
+
* @return 切换成功时 resolve,失败(未找到、切换被中止)时 reject。
|
|
6304
|
+
* @memberof VePlayer
|
|
6305
|
+
*/
|
|
6306
|
+
switchSubtitle(subtitle: {
|
|
6307
|
+
id?: string | number;
|
|
6308
|
+
language?: string | number;
|
|
6309
|
+
}): Promise<void>;
|
|
6310
|
+
/** {zh}
|
|
6311
|
+
* @brief 开启字幕展示。恢复上次选中的字幕项;若从未选中过则默认选第一项。需配置 `Subtitle` 插件后调用。
|
|
6312
|
+
* @memberof VePlayer
|
|
6313
|
+
*/
|
|
6314
|
+
showSubtitle(): void;
|
|
6315
|
+
/** {zh}
|
|
6316
|
+
* @brief 关闭字幕展示。字幕数据保留,可通过 `showSubtitle` 重新开启。需配置 `Subtitle` 插件后调用。
|
|
6317
|
+
* @memberof VePlayer
|
|
6318
|
+
*/
|
|
6319
|
+
hideSubtitle(): void;
|
|
5628
6320
|
/** {zh}
|
|
5629
6321
|
* @memberof VePlayer
|
|
5630
6322
|
* @brief 销毁当前播放器实例。
|
|
@@ -6043,91 +6735,6 @@ export declare class MirrorPlugin extends Plugin {
|
|
|
6043
6735
|
destroy(): void;
|
|
6044
6736
|
render(): string;
|
|
6045
6737
|
}
|
|
6046
|
-
export declare type InfoItem = {
|
|
6047
|
-
key: string;
|
|
6048
|
-
label: string;
|
|
6049
|
-
labelTextKey?: string;
|
|
6050
|
-
value?: any;
|
|
6051
|
-
render?: (key: any) => string;
|
|
6052
|
-
type?: string;
|
|
6053
|
-
dom?: Element;
|
|
6054
|
-
};
|
|
6055
|
-
/**
|
|
6056
|
-
* 直播信息面板
|
|
6057
|
-
*/
|
|
6058
|
-
export declare class LiveInfoPanel extends Plugin {
|
|
6059
|
-
private _pollTimer;
|
|
6060
|
-
private _infoItems;
|
|
6061
|
-
static get pluginName(): string;
|
|
6062
|
-
static get defaultConfig(): {
|
|
6063
|
-
visible: boolean;
|
|
6064
|
-
showH265Info: boolean;
|
|
6065
|
-
};
|
|
6066
|
-
get streamType(): any;
|
|
6067
|
-
afterCreate(): void;
|
|
6068
|
-
registerLanguageTexts(): {
|
|
6069
|
-
DECODEFPS: {
|
|
6070
|
-
en: string;
|
|
6071
|
-
zh: string;
|
|
6072
|
-
};
|
|
6073
|
-
DECODECOST: {
|
|
6074
|
-
en: string;
|
|
6075
|
-
zh: string;
|
|
6076
|
-
};
|
|
6077
|
-
FORMAT: {
|
|
6078
|
-
en: string;
|
|
6079
|
-
zh: string;
|
|
6080
|
-
};
|
|
6081
|
-
FPS: {
|
|
6082
|
-
en: string;
|
|
6083
|
-
zh: string;
|
|
6084
|
-
};
|
|
6085
|
-
BITRATE: {
|
|
6086
|
-
en: string;
|
|
6087
|
-
zh: string;
|
|
6088
|
-
};
|
|
6089
|
-
GOP: {
|
|
6090
|
-
en: string;
|
|
6091
|
-
zh: string;
|
|
6092
|
-
};
|
|
6093
|
-
RESOLUTION: {
|
|
6094
|
-
en: string;
|
|
6095
|
-
zh: string;
|
|
6096
|
-
};
|
|
6097
|
-
ENCODETYPE: {
|
|
6098
|
-
en: string;
|
|
6099
|
-
zh: string;
|
|
6100
|
-
};
|
|
6101
|
-
BUFFEREND: {
|
|
6102
|
-
en: string;
|
|
6103
|
-
zh: string;
|
|
6104
|
-
};
|
|
6105
|
-
CURRENTTIME: {
|
|
6106
|
-
en: string;
|
|
6107
|
-
zh: string;
|
|
6108
|
-
};
|
|
6109
|
-
};
|
|
6110
|
-
_getDefaultInfo(data: any): Record<string, InfoItem>;
|
|
6111
|
-
_init(): void;
|
|
6112
|
-
_getStats(): any;
|
|
6113
|
-
_getInfoListData(): Record<string, InfoItem>;
|
|
6114
|
-
_initDom(infoItems: any): any;
|
|
6115
|
-
_updateTitle(rowDom: Element, item: InfoItem): void;
|
|
6116
|
-
_updateDom(rowdom: Element, newItem: InfoItem): void;
|
|
6117
|
-
_renderLabel(item: InfoItem): any;
|
|
6118
|
-
_renderValue(item: InfoItem): any;
|
|
6119
|
-
_handleDataChange(): void;
|
|
6120
|
-
_tick(): void;
|
|
6121
|
-
_poll(): void;
|
|
6122
|
-
destroy(): void;
|
|
6123
|
-
_handleError(): void;
|
|
6124
|
-
_handleLoadedData(): void;
|
|
6125
|
-
_open(): void;
|
|
6126
|
-
_close(): void;
|
|
6127
|
-
open(): void;
|
|
6128
|
-
close(): void;
|
|
6129
|
-
render(): string;
|
|
6130
|
-
}
|
|
6131
6738
|
export declare const Events: {
|
|
6132
6739
|
/** {zh}
|
|
6133
6740
|
* @brief 弹幕配置发生变化。
|
|
@@ -6154,11 +6761,11 @@ export declare const Events: {
|
|
|
6154
6761
|
*/
|
|
6155
6762
|
REFRESH_CLICK: string;
|
|
6156
6763
|
/** {zh}
|
|
6157
|
-
* @brief
|
|
6764
|
+
* @brief 报错时触发降级。
|
|
6158
6765
|
*/
|
|
6159
6766
|
PLAY_BACKUP_CHANGE: string;
|
|
6160
6767
|
/** {zh}
|
|
6161
|
-
* @brief
|
|
6768
|
+
* @brief 报错时触发的降级结束。
|
|
6162
6769
|
*/
|
|
6163
6770
|
PLAY_BACKUP_CHANGE_FINISH: string;
|
|
6164
6771
|
/** {zh}
|
|
@@ -6189,15 +6796,6 @@ export declare const Events: {
|
|
|
6189
6796
|
* @brief 清晰度降级。
|
|
6190
6797
|
*/
|
|
6191
6798
|
DEFINITION_DEMOTE: string;
|
|
6192
|
-
/** {zh}
|
|
6193
|
-
* @brief 已降至最低清晰度。
|
|
6194
|
-
*/
|
|
6195
|
-
DEFINITION_DEMOTE_ALL_DONE: string;
|
|
6196
|
-
/** {zh}
|
|
6197
|
-
* @brief 所有可执行的降级操作均执行完毕。如果用户同时开启了 definition 降级和 fallbackUrl 降级,
|
|
6198
|
-
* 无论两者哪个优先级更高,待所有可执行的降级操作均执行完毕,会触发该事件。
|
|
6199
|
-
*/
|
|
6200
|
-
DEMOTE_ALL_DONE: string;
|
|
6201
6799
|
/** {zh}
|
|
6202
6800
|
* @hidden
|
|
6203
6801
|
*/
|
|
@@ -6278,6 +6876,13 @@ export declare const Events: {
|
|
|
6278
6876
|
* @brief 多码率自适应播放时,自动挡位对应的清晰度改变。
|
|
6279
6877
|
*/
|
|
6280
6878
|
ABR_AUTO_DESC_CHANGE: string;
|
|
6879
|
+
/** {zh}
|
|
6880
|
+
* @brief mp4 加密插件命中预加载数据时触发。data 为预加载缓存对象,含 `byteLength`、`duration`、`mediaSegList` 等字段。
|
|
6881
|
+
*/
|
|
6882
|
+
/** {en}
|
|
6883
|
+
* @brief Fired when the mp4 encrypt plugin finds a preload cache hit. The event data is the preload cache object, including fields such as `byteLength`, `duration`, and `mediaSegList`.
|
|
6884
|
+
*/
|
|
6885
|
+
PRELOAD_INFO: string;
|
|
6281
6886
|
/** {zh}
|
|
6282
6887
|
* @brief 播放器实例创建完成时触发。
|
|
6283
6888
|
*/
|
|
@@ -6428,10 +7033,21 @@ export declare const Events: {
|
|
|
6428
7033
|
* @brief Autoplay fails to start.
|
|
6429
7034
|
*/
|
|
6430
7035
|
AUTOPLAY_PREVENTED: string;
|
|
7036
|
+
/** {zh}
|
|
7037
|
+
* @brief 播放器准备创建。
|
|
7038
|
+
*/
|
|
7039
|
+
READY_CREATE_PLAYER: string;
|
|
6431
7040
|
/** {zh}
|
|
6432
7041
|
* @brief 播放器完成创建。
|
|
6433
7042
|
*/
|
|
6434
7043
|
PLAYER_CREATED_FINISH: string;
|
|
7044
|
+
/** {zh}
|
|
7045
|
+
* @brief createPlayer 性能报告。与 `PLAYER_CREATED_FINISH` 几乎同时触发(略早)。
|
|
7046
|
+
*/
|
|
7047
|
+
/** {en}
|
|
7048
|
+
* @brief createPlayer performance report. Fired almost at the same time as `PLAYER_CREATED_FINISH` (slightly earlier).
|
|
7049
|
+
*/
|
|
7050
|
+
CREATE_PLAYER_PERF: string;
|
|
6435
7051
|
/** {zh}
|
|
6436
7052
|
* @brief 播放器重建。
|
|
6437
7053
|
*/
|
|
@@ -6751,10 +7367,21 @@ export declare const Event: {
|
|
|
6751
7367
|
* @brief Autoplay fails to start.
|
|
6752
7368
|
*/
|
|
6753
7369
|
AUTOPLAY_PREVENTED: string;
|
|
7370
|
+
/** {zh}
|
|
7371
|
+
* @brief 播放器准备创建。
|
|
7372
|
+
*/
|
|
7373
|
+
READY_CREATE_PLAYER: string;
|
|
6754
7374
|
/** {zh}
|
|
6755
7375
|
* @brief 播放器完成创建。
|
|
6756
7376
|
*/
|
|
6757
7377
|
PLAYER_CREATED_FINISH: string;
|
|
7378
|
+
/** {zh}
|
|
7379
|
+
* @brief createPlayer 性能报告。与 `PLAYER_CREATED_FINISH` 几乎同时触发(略早)。
|
|
7380
|
+
*/
|
|
7381
|
+
/** {en}
|
|
7382
|
+
* @brief createPlayer performance report. Fired almost at the same time as `PLAYER_CREATED_FINISH` (slightly earlier).
|
|
7383
|
+
*/
|
|
7384
|
+
CREATE_PLAYER_PERF: string;
|
|
6758
7385
|
/** {zh}
|
|
6759
7386
|
* @brief 播放器重建。
|
|
6760
7387
|
*/
|
|
@@ -6834,11 +7461,11 @@ export declare const Event: {
|
|
|
6834
7461
|
*/
|
|
6835
7462
|
REFRESH_CLICK: string;
|
|
6836
7463
|
/** {zh}
|
|
6837
|
-
* @brief
|
|
7464
|
+
* @brief 报错时触发降级。
|
|
6838
7465
|
*/
|
|
6839
7466
|
PLAY_BACKUP_CHANGE: string;
|
|
6840
7467
|
/** {zh}
|
|
6841
|
-
* @brief
|
|
7468
|
+
* @brief 报错时触发的降级结束。
|
|
6842
7469
|
*/
|
|
6843
7470
|
PLAY_BACKUP_CHANGE_FINISH: string;
|
|
6844
7471
|
/** {zh}
|
|
@@ -6869,15 +7496,6 @@ export declare const Event: {
|
|
|
6869
7496
|
* @brief 清晰度降级。
|
|
6870
7497
|
*/
|
|
6871
7498
|
DEFINITION_DEMOTE: string;
|
|
6872
|
-
/** {zh}
|
|
6873
|
-
* @brief 已降至最低清晰度。
|
|
6874
|
-
*/
|
|
6875
|
-
DEFINITION_DEMOTE_ALL_DONE: string;
|
|
6876
|
-
/** {zh}
|
|
6877
|
-
* @brief 所有可执行的降级操作均执行完毕。如果用户同时开启了 definition 降级和 fallbackUrl 降级,
|
|
6878
|
-
* 无论两者哪个优先级更高,待所有可执行的降级操作均执行完毕,会触发该事件。
|
|
6879
|
-
*/
|
|
6880
|
-
DEMOTE_ALL_DONE: string;
|
|
6881
7499
|
/** {zh}
|
|
6882
7500
|
* @hidden
|
|
6883
7501
|
*/
|
|
@@ -6958,12 +7576,18 @@ export declare const Event: {
|
|
|
6958
7576
|
* @brief 多码率自适应播放时,自动挡位对应的清晰度改变。
|
|
6959
7577
|
*/
|
|
6960
7578
|
ABR_AUTO_DESC_CHANGE: string;
|
|
7579
|
+
/** {zh}
|
|
7580
|
+
* @brief mp4 加密插件命中预加载数据时触发。data 为预加载缓存对象,含 `byteLength`、`duration`、`mediaSegList` 等字段。
|
|
7581
|
+
*/
|
|
7582
|
+
/** {en}
|
|
7583
|
+
* @brief Fired when the mp4 encrypt plugin finds a preload cache hit. The event data is the preload cache object, including fields such as `byteLength`, `duration`, and `mediaSegList`.
|
|
7584
|
+
*/
|
|
7585
|
+
PRELOAD_INFO: string;
|
|
6961
7586
|
};
|
|
6962
7587
|
};
|
|
6963
7588
|
export * from "xgplayer";
|
|
6964
7589
|
|
|
6965
7590
|
export {
|
|
6966
|
-
LiveSubTitlesPlugin as LiveSubtitlesPlugin,
|
|
6967
7591
|
MusicPreset as Music,
|
|
6968
7592
|
VePlayer as default,
|
|
6969
7593
|
};
|