@volcengine/veplayer 1.12.0-rc.7 → 1.12.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 +181 -360
- package/index.min.js +2 -2
- package/package.json +1 -1
- package/plugin/dash.js +2 -2
- package/plugin/hls.js +1 -1
- package/plugin/hlsEncrypt.js +2 -2
- package/plugin/mp4Encrypt.js +2 -2
package/index.d.ts
CHANGED
|
@@ -258,14 +258,14 @@ export interface IDanmuConfig {
|
|
|
258
258
|
*/
|
|
259
259
|
fontSize?: number;
|
|
260
260
|
/**
|
|
261
|
-
* @brief
|
|
261
|
+
* @brief 是否打开面板。取值如下:
|
|
262
262
|
*
|
|
263
|
-
* - `false
|
|
264
|
-
* - `true
|
|
263
|
+
* - `false`:关闭面板。
|
|
264
|
+
* - `true`:打开面板。
|
|
265
265
|
* @default false
|
|
266
266
|
*/
|
|
267
267
|
/** {en}
|
|
268
|
-
* @brief
|
|
268
|
+
* @brief 是否打开面板
|
|
269
269
|
*/
|
|
270
270
|
active?: boolean;
|
|
271
271
|
/**
|
|
@@ -277,7 +277,7 @@ export interface IDanmuConfig {
|
|
|
277
277
|
* @hidden
|
|
278
278
|
*/
|
|
279
279
|
/** {en}
|
|
280
|
-
* @brief
|
|
280
|
+
* @brief 是否展示弹幕设置面板
|
|
281
281
|
*/
|
|
282
282
|
usePanel?: boolean;
|
|
283
283
|
/**
|
|
@@ -295,13 +295,11 @@ export interface IDanmuConfig {
|
|
|
295
295
|
*/
|
|
296
296
|
external?: ExternalItem[];
|
|
297
297
|
/**
|
|
298
|
-
* @
|
|
299
|
-
* @default -
|
|
298
|
+
* @hidden
|
|
300
299
|
*/
|
|
301
300
|
maskConfig?: IMaskConfig;
|
|
302
301
|
/**
|
|
303
|
-
* @
|
|
304
|
-
* @default false
|
|
302
|
+
* @hidden
|
|
305
303
|
*/
|
|
306
304
|
maskActive?: boolean;
|
|
307
305
|
}
|
|
@@ -1576,11 +1574,6 @@ export interface IStartConfig {
|
|
|
1576
1574
|
*/
|
|
1577
1575
|
mode?: "hide" | "show" | "auto";
|
|
1578
1576
|
}
|
|
1579
|
-
/**
|
|
1580
|
-
* @hidden
|
|
1581
|
-
* @brief 西瓜插件
|
|
1582
|
-
*/
|
|
1583
|
-
export declare type XGPlugin = typeof Plugin | typeof BasePlugin;
|
|
1584
1577
|
/**
|
|
1585
1578
|
* @brief 自动播放配置。
|
|
1586
1579
|
* @list Options
|
|
@@ -2125,9 +2118,14 @@ export declare class MemoryPlay extends Plugin {
|
|
|
2125
2118
|
getTimeByStorage(memoryId: string): string | 0;
|
|
2126
2119
|
destroy(): void;
|
|
2127
2120
|
}
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2121
|
+
/** {zh}
|
|
2122
|
+
* @hidden
|
|
2123
|
+
*/
|
|
2124
|
+
export declare const enum EDRMTYPE {
|
|
2125
|
+
DRM_ENCRYPT = "drm_encrypt",
|
|
2126
|
+
PRIVATE_ENCRYPT = "private_encrypt",
|
|
2127
|
+
PRIVATE_ENCRYPT_UPGRADE = "private_encrypt_upgrade",
|
|
2128
|
+
STANDARD_ENCRYPT = "standard_encrypt"
|
|
2131
2129
|
}
|
|
2132
2130
|
/** {zh}
|
|
2133
2131
|
* @hidden
|
|
@@ -2138,7 +2136,7 @@ export interface IPlayInfoListItem {
|
|
|
2138
2136
|
BarrageMaskOffset: string;
|
|
2139
2137
|
Bitrate: number;
|
|
2140
2138
|
CheckInfo: string;
|
|
2141
|
-
Codec:
|
|
2139
|
+
Codec: CodecType;
|
|
2142
2140
|
Definition: string;
|
|
2143
2141
|
Duration: number;
|
|
2144
2142
|
FileId: string;
|
|
@@ -2243,62 +2241,55 @@ export interface IGetPlayInfoRes {
|
|
|
2243
2241
|
TotalCount: number;
|
|
2244
2242
|
Version: number;
|
|
2245
2243
|
}
|
|
2244
|
+
/**
|
|
2245
|
+
* @author bytedance
|
|
2246
|
+
* @version 1.0
|
|
2247
|
+
* @Description
|
|
2248
|
+
* @date 2024/5/17 15:53
|
|
2249
|
+
*/
|
|
2246
2250
|
/** {zh}
|
|
2247
2251
|
* @list Options
|
|
2248
2252
|
* @brief 视频编码格式。
|
|
2249
2253
|
*/
|
|
2250
|
-
export declare const CodecType
|
|
2254
|
+
export declare const enum CodecType {
|
|
2251
2255
|
/** {zh}
|
|
2252
2256
|
* @brief H.264
|
|
2253
2257
|
*/
|
|
2254
|
-
|
|
2258
|
+
H264 = "h264",
|
|
2255
2259
|
/** {zh}
|
|
2256
2260
|
* @brief H.265
|
|
2257
2261
|
*/
|
|
2258
|
-
|
|
2262
|
+
H265 = "h265",
|
|
2259
2263
|
/** {zh}
|
|
2260
2264
|
* @brief H.266
|
|
2261
2265
|
*/
|
|
2262
|
-
|
|
2266
|
+
H266 = "h266",
|
|
2263
2267
|
/** {zh}
|
|
2264
2268
|
* @brief 音频 AAC,含 heaacv2
|
|
2265
2269
|
*/
|
|
2266
|
-
|
|
2270
|
+
AAC = "aac",
|
|
2267
2271
|
/** {zh}
|
|
2268
2272
|
* @brief 音频 MP3
|
|
2269
2273
|
*/
|
|
2270
|
-
|
|
2274
|
+
MP3 = "mp3",
|
|
2271
2275
|
/** {zh}
|
|
2272
2276
|
* @brief 音频 OPUS
|
|
2273
2277
|
*/
|
|
2274
|
-
|
|
2278
|
+
OPUS = "opus",
|
|
2275
2279
|
/** {zh}
|
|
2276
2280
|
* @brief 未知编码格式
|
|
2277
2281
|
*/
|
|
2278
|
-
|
|
2279
|
-
}
|
|
2280
|
-
|
|
2281
|
-
export declare const ContentType: {
|
|
2282
|
-
h265: string;
|
|
2283
|
-
h264: string;
|
|
2284
|
-
};
|
|
2285
|
-
export declare enum RTMCodec {
|
|
2282
|
+
UNKNOWN = "unknown"
|
|
2283
|
+
}
|
|
2284
|
+
declare enum RTMCodec {
|
|
2286
2285
|
H264 = "h264"
|
|
2287
2286
|
}
|
|
2288
|
-
|
|
2289
|
-
* @hidden
|
|
2290
|
-
* @brief 音频封装格式
|
|
2291
|
-
*/
|
|
2292
|
-
export declare enum EVideoFormat {
|
|
2287
|
+
declare enum EVideoFormat {
|
|
2293
2288
|
MP4 = "mp4",
|
|
2294
2289
|
DASH = "dash",
|
|
2295
2290
|
HLS = "hls"
|
|
2296
2291
|
}
|
|
2297
|
-
|
|
2298
|
-
* @hidden
|
|
2299
|
-
* @brief 视频封装格式
|
|
2300
|
-
*/
|
|
2301
|
-
export declare enum EAudioFormat {
|
|
2292
|
+
declare enum EAudioFormat {
|
|
2302
2293
|
M4A = "m4a",
|
|
2303
2294
|
MP4 = "mp4",
|
|
2304
2295
|
MP3 = "mp3",
|
|
@@ -2306,45 +2297,6 @@ export declare enum EAudioFormat {
|
|
|
2306
2297
|
HLS = "hls",
|
|
2307
2298
|
OGG = "ogg"
|
|
2308
2299
|
}
|
|
2309
|
-
/** {zh}
|
|
2310
|
-
* @brief 加密播放类型
|
|
2311
|
-
*/
|
|
2312
|
-
export declare const enum EDRMTYPE {
|
|
2313
|
-
/**
|
|
2314
|
-
* @brief 商业DRM
|
|
2315
|
-
*/
|
|
2316
|
-
DRM_ENCRYPT = "drm_encrypt",
|
|
2317
|
-
/**
|
|
2318
|
-
* @brief 旧私有加密
|
|
2319
|
-
*/
|
|
2320
|
-
PRIVATE_ENCRYPT = "private_encrypt",
|
|
2321
|
-
/**
|
|
2322
|
-
* @brief 新私有加密
|
|
2323
|
-
*/
|
|
2324
|
-
PRIVATE_ENCRYPT_UPGRADE = "private_encrypt_upgrade",
|
|
2325
|
-
/**
|
|
2326
|
-
* @brief HLS标准加密
|
|
2327
|
-
*/
|
|
2328
|
-
STANDARD_ENCRYPT = "standard_encrypt"
|
|
2329
|
-
}
|
|
2330
|
-
export interface IVideoInfo {
|
|
2331
|
-
playList: Stream[];
|
|
2332
|
-
vid: string;
|
|
2333
|
-
defaultDefinitionData: Stream;
|
|
2334
|
-
codec: ICodecType;
|
|
2335
|
-
dashOpts?: {
|
|
2336
|
-
Data: IGetPlayInfoRes;
|
|
2337
|
-
};
|
|
2338
|
-
}
|
|
2339
|
-
export declare type TRegionConfig = {
|
|
2340
|
-
__PLAY_DOMAIN__: string;
|
|
2341
|
-
__BACKUP_PLAY_DOMAIN__?: string;
|
|
2342
|
-
__LOG_TEA_ID__: number;
|
|
2343
|
-
__LOG_CHANNEL__: TLogChannel;
|
|
2344
|
-
__LOG_CUSTOM_REGION__?: string;
|
|
2345
|
-
__UMD_PRE_PATH__: string;
|
|
2346
|
-
};
|
|
2347
|
-
export declare type TLogChannel = "cn" | "va" | "sg";
|
|
2348
2300
|
/** {zh}
|
|
2349
2301
|
* @brief 区域类型:
|
|
2350
2302
|
* - `'cn'`:中国内地
|
|
@@ -2540,7 +2492,7 @@ export interface Stream extends Partial<IPlayInfoListItem> {
|
|
|
2540
2492
|
* @brief 编码格式
|
|
2541
2493
|
* @default unknown
|
|
2542
2494
|
*/
|
|
2543
|
-
codec?:
|
|
2495
|
+
codec?: CodecType;
|
|
2544
2496
|
/** {zh}
|
|
2545
2497
|
* @brief 线路唯一 ID
|
|
2546
2498
|
*/
|
|
@@ -2586,20 +2538,6 @@ export interface Stream extends Partial<IPlayInfoListItem> {
|
|
|
2586
2538
|
* @default -
|
|
2587
2539
|
*/
|
|
2588
2540
|
urlExpireTimestamp?: number;
|
|
2589
|
-
/**
|
|
2590
|
-
* @brief 视频为加密视频时的密钥KeyId,对应{@link https://www.volcengine.com/docs/4/2918 GetPlayInfo} 接口返回的PlayInfoList项中的 PlayAuthId
|
|
2591
|
-
* @default -
|
|
2592
|
-
*/
|
|
2593
|
-
kid?: string;
|
|
2594
|
-
/** {zh}
|
|
2595
|
-
* @brief 私有加密播放的加密密钥,对应{@link https://www.volcengine.com/docs/4/2918 GetPlayInfo} 接口返回的PlayInfoList项中的 PlayAuth
|
|
2596
|
-
*/
|
|
2597
|
-
secretKey?: string;
|
|
2598
|
-
/**
|
|
2599
|
-
* @brief 视频为加密视频时的加密类型
|
|
2600
|
-
* @default -
|
|
2601
|
-
*/
|
|
2602
|
-
drmType?: EDRMTYPE;
|
|
2603
2541
|
/** {zh}
|
|
2604
2542
|
* @hidden
|
|
2605
2543
|
*/
|
|
@@ -2643,6 +2581,21 @@ export interface Current extends Partial<Stream> {
|
|
|
2643
2581
|
* @default -
|
|
2644
2582
|
*/
|
|
2645
2583
|
lineId?: number | string;
|
|
2584
|
+
/**
|
|
2585
|
+
* @brief 视频编码格式
|
|
2586
|
+
* @default unknown
|
|
2587
|
+
*/
|
|
2588
|
+
codec?: CodecType;
|
|
2589
|
+
/**
|
|
2590
|
+
* @brief 视频为加密视频时的密钥KeyId
|
|
2591
|
+
* @default -
|
|
2592
|
+
*/
|
|
2593
|
+
kid?: string;
|
|
2594
|
+
/**
|
|
2595
|
+
* @brief 视频为加密视频时的加密类型
|
|
2596
|
+
* @default -
|
|
2597
|
+
*/
|
|
2598
|
+
drmType?: EDRMTYPE;
|
|
2646
2599
|
/**
|
|
2647
2600
|
* @brief 地址的过期时间戳,vid模式下不用输入,播放器自动获取。如果是火山引擎的CDN分发地址,在不传入过期时间戳时,则需指定urlType,支持{@link https://www.volcengine.com/docs/4/177191 A-E类型},其他云厂商或者业务服务器存储的地址不支持。
|
|
2648
2601
|
* @default -
|
|
@@ -2717,24 +2670,6 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
2717
2670
|
* @memberof IPlayerConfig
|
|
2718
2671
|
*/
|
|
2719
2672
|
getVideoByToken?: IPlayAuthTokenConfig;
|
|
2720
|
-
/** {zh}
|
|
2721
|
-
* @brief 视频加密类型
|
|
2722
|
-
* @default -
|
|
2723
|
-
*/
|
|
2724
|
-
drmType?: EDRMTYPE;
|
|
2725
|
-
/** {zh}
|
|
2726
|
-
* @brief 私有加密会话id
|
|
2727
|
-
*/
|
|
2728
|
-
encryptSessionId?: string;
|
|
2729
|
-
/**
|
|
2730
|
-
* @brief 视频为加密视频时的密钥KeyId,对应{@link https://www.volcengine.com/docs/4/2918 GetPlayInfo} 接口返回的PlayInfoList项中的 PlayAuthId
|
|
2731
|
-
* @default -
|
|
2732
|
-
*/
|
|
2733
|
-
playAuthId?: string;
|
|
2734
|
-
/** {zh}
|
|
2735
|
-
* @brief 私有加密播放的加密密钥,对应{@link https://www.volcengine.com/docs/4/2918 GetPlayInfo} 接口返回的PlayInfoList项中的 PlayAuth
|
|
2736
|
-
*/
|
|
2737
|
-
playAuth?: string;
|
|
2738
2673
|
/** {zh}
|
|
2739
2674
|
* @brief 视频格式。取值如下:
|
|
2740
2675
|
* - `mp4`
|
|
@@ -2874,7 +2809,7 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
2874
2809
|
* @listtip - 在已知视频编码方式的情况下推荐传入,以便日志分析。
|
|
2875
2810
|
* - 在 `useSoftDecoding` 参数为 `true`(开启 H.265 兼容降级模式)时,建议传入,可提升软解初始效率。
|
|
2876
2811
|
*/
|
|
2877
|
-
codec?:
|
|
2812
|
+
codec?: `${CodecType}`;
|
|
2878
2813
|
/** {zh}
|
|
2879
2814
|
* @brief 点播服务所在区域,影响服务接口和日志上报
|
|
2880
2815
|
* @default cn
|
|
@@ -3593,27 +3528,6 @@ export interface definitionItem {
|
|
|
3593
3528
|
*/
|
|
3594
3529
|
definitionTextKey?: string;
|
|
3595
3530
|
}
|
|
3596
|
-
/** {zh}
|
|
3597
|
-
* @brief 可扩展插件结构
|
|
3598
|
-
*/
|
|
3599
|
-
export interface EventPlugin {
|
|
3600
|
-
pluginName: string;
|
|
3601
|
-
type?: "inner" | "normal" | string;
|
|
3602
|
-
position?: string;
|
|
3603
|
-
icon?: string;
|
|
3604
|
-
index?: number;
|
|
3605
|
-
tips?: Transition;
|
|
3606
|
-
hideAtFullScreen?: boolean;
|
|
3607
|
-
}
|
|
3608
|
-
/** {zh}
|
|
3609
|
-
* @brief 多语言翻译结构体
|
|
3610
|
-
*/
|
|
3611
|
-
export interface Transition {
|
|
3612
|
-
jp?: string;
|
|
3613
|
-
en?: string;
|
|
3614
|
-
zh?: string;
|
|
3615
|
-
"zh-hk"?: string;
|
|
3616
|
-
}
|
|
3617
3531
|
/** {zh}
|
|
3618
3532
|
* @brief 插件按钮位置
|
|
3619
3533
|
*/
|
|
@@ -3660,7 +3574,7 @@ export declare const enum POSITIONS {
|
|
|
3660
3574
|
* @brief Plugin类插件基础配置
|
|
3661
3575
|
*/
|
|
3662
3576
|
export interface IPluginConfig {
|
|
3663
|
-
position?:
|
|
3577
|
+
position?: typeof Plugin.POSITIONS[keyof typeof Plugin.POSITIONS];
|
|
3664
3578
|
index?: number;
|
|
3665
3579
|
disable?: boolean;
|
|
3666
3580
|
}
|
|
@@ -3889,11 +3803,6 @@ export interface IThumbnailConfig {
|
|
|
3889
3803
|
*/
|
|
3890
3804
|
hidePortrait?: false;
|
|
3891
3805
|
}
|
|
3892
|
-
export interface ISourceConfig {
|
|
3893
|
-
url?: string;
|
|
3894
|
-
playList?: Stream[];
|
|
3895
|
-
getVideByToken?: IPlayAuthTokenConfig;
|
|
3896
|
-
}
|
|
3897
3806
|
/**
|
|
3898
3807
|
* @brief api map
|
|
3899
3808
|
* @hidden
|
|
@@ -4242,166 +4151,6 @@ declare class VeStrategyWrapper {
|
|
|
4242
4151
|
private initPreloaderConfig;
|
|
4243
4152
|
}
|
|
4244
4153
|
declare const _default: VeStrategyWrapper;
|
|
4245
|
-
declare enum UmdKeys {
|
|
4246
|
-
HLS = "hls",
|
|
4247
|
-
FLV = "flv",
|
|
4248
|
-
XGVideo = "XGVideo",
|
|
4249
|
-
HLSEncrypt = "hlsEncrypt",
|
|
4250
|
-
DASH = "dash",
|
|
4251
|
-
MP4Encrypt = "mp4Encrypt",
|
|
4252
|
-
DanmuJS = "danmujs",
|
|
4253
|
-
DanmuMask = "danmuMask",
|
|
4254
|
-
StreamProbe = "streamprobe",
|
|
4255
|
-
VeStrategy = "vestrategy",
|
|
4256
|
-
VeStrategyH265 = "vestrategy_h265",
|
|
4257
|
-
VeStrategyPreload = "vestrategy_preload",
|
|
4258
|
-
VeStrategyAdaptRange = "vestrategy_adapt_range",
|
|
4259
|
-
DashAbralgo = "DashAbralgo",
|
|
4260
|
-
Preloader = "preloader"
|
|
4261
|
-
}
|
|
4262
|
-
/**
|
|
4263
|
-
* @hidden
|
|
4264
|
-
* @breif umdmap 配置
|
|
4265
|
-
*/
|
|
4266
|
-
export declare type UMDMap = Record<UmdKeys, {
|
|
4267
|
-
/**
|
|
4268
|
-
* umd Module 的名称,即在window下暴露的接口名称
|
|
4269
|
-
*/
|
|
4270
|
-
name: string;
|
|
4271
|
-
/**
|
|
4272
|
-
* 对应umd文件名,只用来标记,实际不使用
|
|
4273
|
-
*/
|
|
4274
|
-
pluginName?: string;
|
|
4275
|
-
/**
|
|
4276
|
-
* 对应npm包的名称,在打包文件时,会在libd.config.js中onPostBuild的钩子中会用于寻找对应npm包
|
|
4277
|
-
*/
|
|
4278
|
-
packageName: string;
|
|
4279
|
-
/**
|
|
4280
|
-
* npm包中umd入口文件路径,用于打包上传到cdn目录
|
|
4281
|
-
*/
|
|
4282
|
-
devPath: string;
|
|
4283
|
-
}>;
|
|
4284
|
-
declare class UMDLoader {
|
|
4285
|
-
private static jsLoadMap;
|
|
4286
|
-
private static jsLoadPromiseMap;
|
|
4287
|
-
umdMap: UMDMap;
|
|
4288
|
-
backupUmdUrlMap: Record<string, string>;
|
|
4289
|
-
failCallback: (umdName: string, err: any) => any;
|
|
4290
|
-
region: TRegionType;
|
|
4291
|
-
customPluginPublicPath: string;
|
|
4292
|
-
importedPlugins: any[];
|
|
4293
|
-
constructor();
|
|
4294
|
-
/**
|
|
4295
|
-
* @return { string } 插件加载的公共路径
|
|
4296
|
-
*/
|
|
4297
|
-
get pluginPublicPath(): string;
|
|
4298
|
-
/**
|
|
4299
|
-
* 更新umd的备用地址
|
|
4300
|
-
* @param {Record<string, string>} map 备用地址map
|
|
4301
|
-
*/
|
|
4302
|
-
updateBackupMap(map: Record<string, string>): void;
|
|
4303
|
-
/**
|
|
4304
|
-
* 加载额外的js-sdk
|
|
4305
|
-
* 适用 umd 模块
|
|
4306
|
-
* 只能浏览器环境下使用
|
|
4307
|
-
* @param url 额外加载JS 的 CDN 地址
|
|
4308
|
-
* @param isJs 是否js文件
|
|
4309
|
-
*/
|
|
4310
|
-
loadExtraCdn(url: string, isJs?: boolean): Promise<void>;
|
|
4311
|
-
/**
|
|
4312
|
-
* @description 加载xgplayer插件
|
|
4313
|
-
* @param pluginName 插件名称
|
|
4314
|
-
* @param successCallback 加载完成后执行的回调
|
|
4315
|
-
* @return Promise<any>
|
|
4316
|
-
*/
|
|
4317
|
-
loadPlugins(pluginName: UmdKeys, successCallback?: () => void): Promise<any>;
|
|
4318
|
-
}
|
|
4319
|
-
export declare class SdkPlugin {
|
|
4320
|
-
pluginName: string;
|
|
4321
|
-
__args: any;
|
|
4322
|
-
sdk: VePlayer;
|
|
4323
|
-
playerData: PlayerData;
|
|
4324
|
-
player: Player;
|
|
4325
|
-
_emitter: EventEmitter;
|
|
4326
|
-
static defineGetterOrSetter(Obj: any, map: any): void;
|
|
4327
|
-
/**
|
|
4328
|
-
* @type { string }
|
|
4329
|
-
*/
|
|
4330
|
-
static get pluginName(): string;
|
|
4331
|
-
/**
|
|
4332
|
-
* @constructor
|
|
4333
|
-
* @param { { sdk: object, pluginName: string, [propName: string]: any;} } args
|
|
4334
|
-
*/
|
|
4335
|
-
constructor(args: any);
|
|
4336
|
-
/**
|
|
4337
|
-
* @description sdk实例创建,挂载插件实例时首先执行
|
|
4338
|
-
*/
|
|
4339
|
-
beforeCreate(): void;
|
|
4340
|
-
/**
|
|
4341
|
-
* @description sdk实例创建,挂载插件实例完后执行
|
|
4342
|
-
*/
|
|
4343
|
-
afterCreate(): void;
|
|
4344
|
-
/**
|
|
4345
|
-
* @description sdk创建播放器前执行,只有这里能保证异步操作在creatPlayer之前同步完成
|
|
4346
|
-
*/
|
|
4347
|
-
beforePlayerCreate(): void;
|
|
4348
|
-
/**
|
|
4349
|
-
* @description sdk创建播放器完执行
|
|
4350
|
-
*/
|
|
4351
|
-
afterPlayerCreate(): void;
|
|
4352
|
-
/**
|
|
4353
|
-
* @description sdk销毁时执行
|
|
4354
|
-
*/
|
|
4355
|
-
destroy(): void;
|
|
4356
|
-
/**
|
|
4357
|
-
* @private
|
|
4358
|
-
* @param { any } args
|
|
4359
|
-
*/
|
|
4360
|
-
__init(args: any): void;
|
|
4361
|
-
/**
|
|
4362
|
-
* @description 插件销毁
|
|
4363
|
-
* @private
|
|
4364
|
-
*/
|
|
4365
|
-
__destroy(): void;
|
|
4366
|
-
}
|
|
4367
|
-
declare class AuthToken extends SdkPlugin {
|
|
4368
|
-
static get pluginName(): string;
|
|
4369
|
-
isPlayByToken: boolean;
|
|
4370
|
-
isEncrypt: boolean;
|
|
4371
|
-
tokenInfo: ITokenInfo;
|
|
4372
|
-
keyTokenInfo: ITokenInfo;
|
|
4373
|
-
thirdPartyDrmAuthTokenInfo: ITokenInfo;
|
|
4374
|
-
config: IPlayAuthTokenConfig;
|
|
4375
|
-
privateDrmAuthToken: string;
|
|
4376
|
-
useUnionInfoDRM: boolean;
|
|
4377
|
-
sessionId: string;
|
|
4378
|
-
retryCount: number;
|
|
4379
|
-
playInfo?: VideoInfoRes;
|
|
4380
|
-
constructor(args: any);
|
|
4381
|
-
beforePlayerCreate(): Promise<void>;
|
|
4382
|
-
getVideoInfo(): Promise<{
|
|
4383
|
-
vid: string;
|
|
4384
|
-
playList: Stream[];
|
|
4385
|
-
codec: ICodecType;
|
|
4386
|
-
defaultDefinition: string;
|
|
4387
|
-
}>;
|
|
4388
|
-
getVideos(): Promise<any>;
|
|
4389
|
-
getPrivateDrmInfo(playList: Stream[], vid: string, streamType: string): Promise<void>;
|
|
4390
|
-
getThumbnailConfig(thumbs: IThumbInfoItem[]): void;
|
|
4391
|
-
getBarrageMaskUrl(url: string): void;
|
|
4392
|
-
getDrmConfig(videoInfo: IVideoInfo): void;
|
|
4393
|
-
init(): void;
|
|
4394
|
-
initConfig(getVideoByToken: IPlayAuthTokenConfig): void;
|
|
4395
|
-
/**
|
|
4396
|
-
* @description 更新playAuthToken
|
|
4397
|
-
* @param {IPlayAuthTokenConfig} getVideoByToken token信息
|
|
4398
|
-
* @param {boolean} isNewVideo 是否新视频,即是否为切换视频
|
|
4399
|
-
*/
|
|
4400
|
-
updateAuthToken(getVideoByToken: IPlayAuthTokenConfig, isNewVideo: boolean): Promise<void>;
|
|
4401
|
-
checkPlayAuthTokenValid(): boolean;
|
|
4402
|
-
checkKeyTokenValid(): boolean;
|
|
4403
|
-
checkDrmAuthTokenValid(): boolean;
|
|
4404
|
-
}
|
|
4405
4154
|
/** {zh}
|
|
4406
4155
|
* @hidden
|
|
4407
4156
|
*/
|
|
@@ -4443,8 +4192,6 @@ declare abstract class AbstractBaseAdapter {
|
|
|
4443
4192
|
abstract adaptRangeDefaultOptions(): IAdaptRangeDefaultOptions | undefined;
|
|
4444
4193
|
abstract applyAdaptRangePluginConfig(_finalOptions: any, _adaptRangeOptions: any): void;
|
|
4445
4194
|
abstract applyAdaptRangeStrategy(_finalOptions: any, _adaptRangeOptions: any): void;
|
|
4446
|
-
abstract getPlugins(umdLoader: UMDLoader): Promise<XGPlugin[]>;
|
|
4447
|
-
abstract setPluginConfigInVid(videoInfo: IVideoInfo, context: AuthToken): void;
|
|
4448
4195
|
}
|
|
4449
4196
|
declare class PlayerData {
|
|
4450
4197
|
id?: string;
|
|
@@ -4460,7 +4207,7 @@ declare class PlayerData {
|
|
|
4460
4207
|
openSoftDecoding: boolean;
|
|
4461
4208
|
defaultConfig: IDefaultConfig | undefined;
|
|
4462
4209
|
isHitDefault: boolean;
|
|
4463
|
-
codec?:
|
|
4210
|
+
codec?: `${CodecType}`;
|
|
4464
4211
|
enableH265Degrade: boolean;
|
|
4465
4212
|
languageData: {
|
|
4466
4213
|
extraLangList: IXGI18nText[];
|
|
@@ -4491,25 +4238,12 @@ declare class PlayerData {
|
|
|
4491
4238
|
};
|
|
4492
4239
|
private isAutoBitrateEnable;
|
|
4493
4240
|
adapter: AbstractBaseAdapter;
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
*/
|
|
4497
|
-
isVidEncrypt: boolean;
|
|
4241
|
+
isBusinessDrm: boolean;
|
|
4242
|
+
isEncrypt: boolean;
|
|
4498
4243
|
dashOpts: {
|
|
4499
4244
|
Data: IGetPlayInfoRes;
|
|
4500
4245
|
};
|
|
4501
|
-
/**
|
|
4502
|
-
* @brief 播放器sdk实例
|
|
4503
|
-
*/
|
|
4504
4246
|
sdk: VePlayer;
|
|
4505
|
-
/**
|
|
4506
|
-
* @brief 当前加密播放类型,为空则表示非加密
|
|
4507
|
-
*/
|
|
4508
|
-
drmType: EDRMTYPE;
|
|
4509
|
-
/**
|
|
4510
|
-
* @brief 私有加密会话id
|
|
4511
|
-
*/
|
|
4512
|
-
encryptSessionId?: string;
|
|
4513
4247
|
constructor(configs: IPlayerConfig & {
|
|
4514
4248
|
licensSupportModuleList: string[];
|
|
4515
4249
|
}, sdk: VePlayer);
|
|
@@ -4526,7 +4260,6 @@ declare class PlayerData {
|
|
|
4526
4260
|
playList: Stream[];
|
|
4527
4261
|
};
|
|
4528
4262
|
isCurrentH265(): boolean;
|
|
4529
|
-
setDrmType(drmType: EDRMTYPE): void;
|
|
4530
4263
|
getCurrentByDefaultConfig(): Stream;
|
|
4531
4264
|
initCurrent(currentStreams: Stream): void;
|
|
4532
4265
|
initCheckExpireData(): void;
|
|
@@ -4639,6 +4372,80 @@ declare class MobilePlayerPanel {
|
|
|
4639
4372
|
bind(event: string, eventHandle: any, isBubble?: boolean): void;
|
|
4640
4373
|
destroy(): void;
|
|
4641
4374
|
}
|
|
4375
|
+
declare enum UmdKeys {
|
|
4376
|
+
HLS = "hls",
|
|
4377
|
+
FLV = "flv",
|
|
4378
|
+
XGVideo = "XGVideo",
|
|
4379
|
+
HLSEncrypt = "hlsEncrypt",
|
|
4380
|
+
DASH = "dash",
|
|
4381
|
+
MP4Encrypt = "mp4Encrypt",
|
|
4382
|
+
DanmuJS = "danmujs",
|
|
4383
|
+
DanmuMask = "danmuMask",
|
|
4384
|
+
StreamProbe = "streamprobe",
|
|
4385
|
+
VeStrategy = "vestrategy",
|
|
4386
|
+
VeStrategyH265 = "vestrategy_h265",
|
|
4387
|
+
VeStrategyPreload = "vestrategy_preload",
|
|
4388
|
+
VeStrategyAdaptRange = "vestrategy_adapt_range",
|
|
4389
|
+
DashAbralgo = "DashAbralgo",
|
|
4390
|
+
Preloader = "preloader"
|
|
4391
|
+
}
|
|
4392
|
+
/**
|
|
4393
|
+
* @hidden
|
|
4394
|
+
* @breif umdmap 配置
|
|
4395
|
+
*/
|
|
4396
|
+
export declare type UMDMap = Record<UmdKeys, {
|
|
4397
|
+
/**
|
|
4398
|
+
* umd Module 的名称,即在window下暴露的接口名称
|
|
4399
|
+
*/
|
|
4400
|
+
name: string;
|
|
4401
|
+
/**
|
|
4402
|
+
* 对应umd文件名,只用来标记,实际不使用
|
|
4403
|
+
*/
|
|
4404
|
+
pluginName?: string;
|
|
4405
|
+
/**
|
|
4406
|
+
* 对应npm包的名称,在打包文件时,会在libd.config.js中onPostBuild的钩子中会用于寻找对应npm包
|
|
4407
|
+
*/
|
|
4408
|
+
packageName: string;
|
|
4409
|
+
/**
|
|
4410
|
+
* npm包中umd入口文件路径,用于打包上传到cdn目录
|
|
4411
|
+
*/
|
|
4412
|
+
devPath: string;
|
|
4413
|
+
}>;
|
|
4414
|
+
declare class umdLoader {
|
|
4415
|
+
private static jsLoadMap;
|
|
4416
|
+
private static jsLoadPromiseMap;
|
|
4417
|
+
umdMap: UMDMap;
|
|
4418
|
+
backupUmdUrlMap: Record<string, string>;
|
|
4419
|
+
failCallback: (umdName: string, err: any) => any;
|
|
4420
|
+
region: TRegionType;
|
|
4421
|
+
customPluginPublicPath: string;
|
|
4422
|
+
importedPlugins: any[];
|
|
4423
|
+
constructor();
|
|
4424
|
+
/**
|
|
4425
|
+
* @return { string } 插件加载的公共路径
|
|
4426
|
+
*/
|
|
4427
|
+
get pluginPublicPath(): string;
|
|
4428
|
+
/**
|
|
4429
|
+
* 更新umd的备用地址
|
|
4430
|
+
* @param {Record<string, string>} map 备用地址map
|
|
4431
|
+
*/
|
|
4432
|
+
updateBackupMap(map: Record<string, string>): void;
|
|
4433
|
+
/**
|
|
4434
|
+
* 加载额外的js-sdk
|
|
4435
|
+
* 适用 umd 模块
|
|
4436
|
+
* 只能浏览器环境下使用
|
|
4437
|
+
* @param url 额外加载JS 的 CDN 地址
|
|
4438
|
+
* @param isJs 是否js文件
|
|
4439
|
+
*/
|
|
4440
|
+
loadExtraCdn(url: string, isJs?: boolean): Promise<void>;
|
|
4441
|
+
/**
|
|
4442
|
+
* @description 加载xgplayer插件
|
|
4443
|
+
* @param pluginName 插件名称
|
|
4444
|
+
* @param successCallback 加载完成后执行的回调
|
|
4445
|
+
* @return Promise<any>
|
|
4446
|
+
*/
|
|
4447
|
+
loadPlugins(pluginName: UmdKeys, successCallback?: () => void): Promise<any>;
|
|
4448
|
+
}
|
|
4642
4449
|
export interface IlicenseContent {
|
|
4643
4450
|
content: string;
|
|
4644
4451
|
sign: string;
|
|
@@ -4687,23 +4494,6 @@ export declare type PlayerCore = Player & {
|
|
|
4687
4494
|
licenseType: LicenseEdition;
|
|
4688
4495
|
};
|
|
4689
4496
|
};
|
|
4690
|
-
/**
|
|
4691
|
-
* @brief 加密混淆信息
|
|
4692
|
-
*/
|
|
4693
|
-
export interface EncryptInfo {
|
|
4694
|
-
/**
|
|
4695
|
-
* @breif 会话ID
|
|
4696
|
-
*/
|
|
4697
|
-
sessionId: string;
|
|
4698
|
-
/**
|
|
4699
|
-
* @brief 混淆后的公钥
|
|
4700
|
-
*/
|
|
4701
|
-
drmKeK: string;
|
|
4702
|
-
/**
|
|
4703
|
-
* @breif 唯一身份信息
|
|
4704
|
-
*/
|
|
4705
|
-
unionInfo: string;
|
|
4706
|
-
}
|
|
4707
4497
|
declare class VePlayer {
|
|
4708
4498
|
/** {zh}
|
|
4709
4499
|
* @brief 播放相关配置数据
|
|
@@ -4806,7 +4596,7 @@ declare class VePlayer {
|
|
|
4806
4596
|
* @type {*}
|
|
4807
4597
|
* @memberof VePlayer
|
|
4808
4598
|
*/
|
|
4809
|
-
sdkUmdLoader:
|
|
4599
|
+
sdkUmdLoader: umdLoader;
|
|
4810
4600
|
private adapter;
|
|
4811
4601
|
/**
|
|
4812
4602
|
* @hidden
|
|
@@ -4826,16 +4616,10 @@ declare class VePlayer {
|
|
|
4826
4616
|
* @memberof VePlayer
|
|
4827
4617
|
*/
|
|
4828
4618
|
static sdkVersion: string;
|
|
4829
|
-
/**
|
|
4830
|
-
* @hidden
|
|
4831
|
-
* @private 私有加密会话id
|
|
4832
|
-
*/
|
|
4833
|
-
private static privateEncryptSessionId;
|
|
4834
4619
|
/**
|
|
4835
4620
|
* @hidden
|
|
4836
4621
|
*/
|
|
4837
4622
|
private veErrorIns;
|
|
4838
|
-
private vodLogCommon;
|
|
4839
4623
|
/** {zh}
|
|
4840
4624
|
* @brief 播放策略预初始化配置
|
|
4841
4625
|
* @param options 初始化配置,详情见{@link StrategyInitOptions}
|
|
@@ -4882,12 +4666,7 @@ declare class VePlayer {
|
|
|
4882
4666
|
static checkModuleList(): Promise<string[]>;
|
|
4883
4667
|
static checkLicenseStatus(): Promise<LicenseStatus>;
|
|
4884
4668
|
static checkLicenseModuleAuth(module: string, featureName: LicenseFeature): Promise<boolean>;
|
|
4885
|
-
|
|
4886
|
-
* @breif 生成加密混淆的数据信息
|
|
4887
|
-
* @param unionId 用户唯一id
|
|
4888
|
-
* @param streamType 私有加密视频的格式/协议,取值有:hls、mp4、dash。
|
|
4889
|
-
*/
|
|
4890
|
-
static generateEncryptInfo(unionId: string, streamType: "hls" | "mp4" | "dash"): Promise<EncryptInfo | undefined>;
|
|
4669
|
+
private static vodLogCommon;
|
|
4891
4670
|
private static hasInitVeStrategy;
|
|
4892
4671
|
/**
|
|
4893
4672
|
* @hidden
|
|
@@ -4928,18 +4707,12 @@ declare class VePlayer {
|
|
|
4928
4707
|
* @memberof VePlayer
|
|
4929
4708
|
*/
|
|
4930
4709
|
private _initCheckExpire;
|
|
4931
|
-
/**
|
|
4932
|
-
* @hidden
|
|
4933
|
-
* @description 初始化umdLoader 的配置
|
|
4934
|
-
* @memberof VePlayer
|
|
4935
|
-
*/
|
|
4936
|
-
private initUmdLoader;
|
|
4937
4710
|
/**
|
|
4938
4711
|
* @hidden
|
|
4939
4712
|
* @description 更新umdLoader 的配置
|
|
4940
4713
|
* @memberof VePlayer
|
|
4941
4714
|
*/
|
|
4942
|
-
private
|
|
4715
|
+
private initUmdLoader;
|
|
4943
4716
|
/**
|
|
4944
4717
|
* @hidden
|
|
4945
4718
|
* @private
|
|
@@ -5286,7 +5059,7 @@ declare class VePlayer {
|
|
|
5286
5059
|
getSoftDecodingOption(isOpenSoftDecoding: boolean, url: string, type: string): Promise<{
|
|
5287
5060
|
mediaType?: string;
|
|
5288
5061
|
innerDegrade?: number;
|
|
5289
|
-
codecType?:
|
|
5062
|
+
codecType?: `${CodecType}`;
|
|
5290
5063
|
plugins?: any[];
|
|
5291
5064
|
}>;
|
|
5292
5065
|
/** {zh}
|
|
@@ -5954,6 +5727,54 @@ export declare class LiveInfoPanel extends Plugin {
|
|
|
5954
5727
|
close(): void;
|
|
5955
5728
|
render(): string;
|
|
5956
5729
|
}
|
|
5730
|
+
export declare class SdkPlugin {
|
|
5731
|
+
pluginName: string;
|
|
5732
|
+
__args: any;
|
|
5733
|
+
sdk: VePlayer;
|
|
5734
|
+
playerData: PlayerData;
|
|
5735
|
+
player: Player;
|
|
5736
|
+
_emitter: EventEmitter;
|
|
5737
|
+
static defineGetterOrSetter(Obj: any, map: any): void;
|
|
5738
|
+
/**
|
|
5739
|
+
* @type { string }
|
|
5740
|
+
*/
|
|
5741
|
+
static get pluginName(): string;
|
|
5742
|
+
/**
|
|
5743
|
+
* @constructor
|
|
5744
|
+
* @param { { sdk: object, pluginName: string, [propName: string]: any;} } args
|
|
5745
|
+
*/
|
|
5746
|
+
constructor(args: any);
|
|
5747
|
+
/**
|
|
5748
|
+
* @description sdk实例创建,挂载插件实例时首先执行
|
|
5749
|
+
*/
|
|
5750
|
+
beforeCreate(): void;
|
|
5751
|
+
/**
|
|
5752
|
+
* @description sdk实例创建,挂载插件实例完后执行
|
|
5753
|
+
*/
|
|
5754
|
+
afterCreate(): void;
|
|
5755
|
+
/**
|
|
5756
|
+
* @description sdk创建播放器前执行,只有这里能保证异步操作在creatPlayer之前同步完成
|
|
5757
|
+
*/
|
|
5758
|
+
beforePlayerCreate(): void;
|
|
5759
|
+
/**
|
|
5760
|
+
* @description sdk创建播放器完执行
|
|
5761
|
+
*/
|
|
5762
|
+
afterPlayerCreate(): void;
|
|
5763
|
+
/**
|
|
5764
|
+
* @description sdk销毁时执行
|
|
5765
|
+
*/
|
|
5766
|
+
destroy(): void;
|
|
5767
|
+
/**
|
|
5768
|
+
* @private
|
|
5769
|
+
* @param { any } args
|
|
5770
|
+
*/
|
|
5771
|
+
__init(args: any): void;
|
|
5772
|
+
/**
|
|
5773
|
+
* @description 插件销毁
|
|
5774
|
+
* @private
|
|
5775
|
+
*/
|
|
5776
|
+
__destroy(): void;
|
|
5777
|
+
}
|
|
5957
5778
|
export declare const Events: {
|
|
5958
5779
|
/** {zh}
|
|
5959
5780
|
* @brief 弹幕配置发生变化。
|