@volcengine/veplayer 1.12.0-rc.9 → 1.13.0-rc.0

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
@@ -260,14 +260,14 @@ export interface IDanmuConfig {
260
260
  */
261
261
  fontSize?: number;
262
262
  /**
263
- * @brief 是否打开面板。取值如下:
263
+ * @brief 是否默认开启弹幕。取值如下:
264
264
  *
265
- * - `false`:关闭面板。
266
- * - `true`:打开面板。
265
+ * - `false`:关闭。
266
+ * - `true`:开启。
267
267
  * @default false
268
268
  */
269
269
  /** {en}
270
- * @brief 是否打开面板
270
+ * @brief 是否默认开启弹幕
271
271
  */
272
272
  active?: boolean;
273
273
  /**
@@ -279,7 +279,7 @@ export interface IDanmuConfig {
279
279
  * @hidden
280
280
  */
281
281
  /** {en}
282
- * @brief 是否展示弹幕设置面板
282
+ * @brief Whether to enable barrage by default
283
283
  */
284
284
  usePanel?: boolean;
285
285
  /**
@@ -297,11 +297,13 @@ export interface IDanmuConfig {
297
297
  */
298
298
  external?: ExternalItem[];
299
299
  /**
300
- * @hidden
300
+ * @brief 蒙版弹幕配置
301
+ * @default -
301
302
  */
302
303
  maskConfig?: IMaskConfig;
303
304
  /**
304
- * @hidden
305
+ * @brief 是否开启蒙版弹幕,即对应智能挡板开关
306
+ * @default false
305
307
  */
306
308
  maskActive?: boolean;
307
309
  }
@@ -1576,6 +1578,11 @@ export interface IStartConfig {
1576
1578
  */
1577
1579
  mode?: "hide" | "show" | "auto";
1578
1580
  }
1581
+ /**
1582
+ * @hidden
1583
+ * @brief 西瓜插件
1584
+ */
1585
+ export declare type XGPlugin = typeof Plugin | typeof BasePlugin;
1579
1586
  /**
1580
1587
  * @brief 自动播放配置。
1581
1588
  * @list Options
@@ -2120,14 +2127,9 @@ export declare class MemoryPlay extends Plugin {
2120
2127
  getTimeByStorage(memoryId: string): string | 0;
2121
2128
  destroy(): void;
2122
2129
  }
2123
- /** {zh}
2124
- * @hidden
2125
- */
2126
- export declare const enum EDRMTYPE {
2127
- DRM_ENCRYPT = "drm_encrypt",
2128
- PRIVATE_ENCRYPT = "private_encrypt",
2129
- PRIVATE_ENCRYPT_UPGRADE = "private_encrypt_upgrade",
2130
- STANDARD_ENCRYPT = "standard_encrypt"
2130
+ export interface IVolume {
2131
+ Loudness: number;
2132
+ Peak: number;
2131
2133
  }
2132
2134
  /** {zh}
2133
2135
  * @hidden
@@ -2138,7 +2140,7 @@ export interface IPlayInfoListItem {
2138
2140
  BarrageMaskOffset: string;
2139
2141
  Bitrate: number;
2140
2142
  CheckInfo: string;
2141
- Codec: CodecType;
2143
+ Codec: ICodecType;
2142
2144
  Definition: string;
2143
2145
  Duration: number;
2144
2146
  FileId: string;
@@ -2243,55 +2245,62 @@ export interface IGetPlayInfoRes {
2243
2245
  TotalCount: number;
2244
2246
  Version: number;
2245
2247
  }
2246
- /**
2247
- * @author bytedance
2248
- * @version 1.0
2249
- * @Description
2250
- * @date 2024/5/17 15:53
2251
- */
2252
2248
  /** {zh}
2253
2249
  * @list Options
2254
2250
  * @brief 视频编码格式。
2255
2251
  */
2256
- export declare const enum CodecType {
2252
+ export declare const CodecType: {
2257
2253
  /** {zh}
2258
2254
  * @brief H.264
2259
2255
  */
2260
- H264 = "h264",
2256
+ readonly H264: "h264";
2261
2257
  /** {zh}
2262
2258
  * @brief H.265
2263
2259
  */
2264
- H265 = "h265",
2260
+ readonly H265: "h265";
2265
2261
  /** {zh}
2266
2262
  * @brief H.266
2267
2263
  */
2268
- H266 = "h266",
2264
+ readonly H266: "h266";
2269
2265
  /** {zh}
2270
2266
  * @brief 音频 AAC,含 heaacv2
2271
2267
  */
2272
- AAC = "aac",
2268
+ readonly AAC: "aac";
2273
2269
  /** {zh}
2274
2270
  * @brief 音频 MP3
2275
2271
  */
2276
- MP3 = "mp3",
2272
+ readonly MP3: "mp3";
2277
2273
  /** {zh}
2278
2274
  * @brief 音频 OPUS
2279
2275
  */
2280
- OPUS = "opus",
2276
+ readonly OPUS: "opus";
2281
2277
  /** {zh}
2282
2278
  * @brief 未知编码格式
2283
2279
  */
2284
- UNKNOWN = "unknown"
2285
- }
2286
- declare enum RTMCodec {
2280
+ readonly UNKNOWN: "unknown";
2281
+ };
2282
+ export declare type ICodecType = (typeof CodecType)[keyof typeof CodecType];
2283
+ export declare const ContentType: {
2284
+ h265: string;
2285
+ h264: string;
2286
+ };
2287
+ export declare enum RTMCodec {
2287
2288
  H264 = "h264"
2288
2289
  }
2289
- declare enum EVideoFormat {
2290
+ /** {zh}
2291
+ * @hidden
2292
+ * @brief 音频封装格式
2293
+ */
2294
+ export declare enum EVideoFormat {
2290
2295
  MP4 = "mp4",
2291
2296
  DASH = "dash",
2292
2297
  HLS = "hls"
2293
2298
  }
2294
- declare enum EAudioFormat {
2299
+ /** {zh}
2300
+ * @hidden
2301
+ * @brief 视频封装格式
2302
+ */
2303
+ export declare enum EAudioFormat {
2295
2304
  M4A = "m4a",
2296
2305
  MP4 = "mp4",
2297
2306
  MP3 = "mp3",
@@ -2299,6 +2308,45 @@ declare enum EAudioFormat {
2299
2308
  HLS = "hls",
2300
2309
  OGG = "ogg"
2301
2310
  }
2311
+ /** {zh}
2312
+ * @brief 加密播放类型
2313
+ */
2314
+ export declare const enum EDRMTYPE {
2315
+ /**
2316
+ * @brief 商业DRM
2317
+ */
2318
+ DRM_ENCRYPT = "drm_encrypt",
2319
+ /**
2320
+ * @brief 旧私有加密
2321
+ */
2322
+ PRIVATE_ENCRYPT = "private_encrypt",
2323
+ /**
2324
+ * @brief 新私有加密
2325
+ */
2326
+ PRIVATE_ENCRYPT_UPGRADE = "private_encrypt_upgrade",
2327
+ /**
2328
+ * @brief HLS标准加密
2329
+ */
2330
+ STANDARD_ENCRYPT = "standard_encrypt"
2331
+ }
2332
+ export interface IVideoInfo {
2333
+ playList: Stream[];
2334
+ vid: string;
2335
+ defaultDefinitionData: Stream;
2336
+ codec: ICodecType;
2337
+ dashOpts?: {
2338
+ Data: IGetPlayInfoRes;
2339
+ };
2340
+ }
2341
+ export declare type TRegionConfig = {
2342
+ __PLAY_DOMAIN__: string;
2343
+ __BACKUP_PLAY_DOMAIN__?: string;
2344
+ __LOG_TEA_ID__: number;
2345
+ __LOG_CHANNEL__: TLogChannel;
2346
+ __LOG_CUSTOM_REGION__?: string;
2347
+ __UMD_PRE_PATH__: string;
2348
+ };
2349
+ export declare type TLogChannel = "cn" | "va" | "sg";
2302
2350
  /** {zh}
2303
2351
  * @brief 区域类型:
2304
2352
  * - `'cn'`:中国内地
@@ -2494,7 +2542,7 @@ export interface Stream extends Partial<IPlayInfoListItem> {
2494
2542
  * @brief 编码格式
2495
2543
  * @default unknown
2496
2544
  */
2497
- codec?: CodecType;
2545
+ codec?: ICodecType;
2498
2546
  /** {zh}
2499
2547
  * @brief 线路唯一 ID
2500
2548
  */
@@ -2540,6 +2588,20 @@ export interface Stream extends Partial<IPlayInfoListItem> {
2540
2588
  * @default -
2541
2589
  */
2542
2590
  urlExpireTimestamp?: number;
2591
+ /**
2592
+ * @brief 视频为加密视频时的密钥KeyId,对应{@link https://www.volcengine.com/docs/4/2918 GetPlayInfo} 接口返回的PlayInfoList项中的 PlayAuthId
2593
+ * @default -
2594
+ */
2595
+ kid?: string;
2596
+ /** {zh}
2597
+ * @brief 私有加密播放的加密密钥,对应{@link https://www.volcengine.com/docs/4/2918 GetPlayInfo} 接口返回的PlayInfoList项中的 PlayAuth
2598
+ */
2599
+ secretKey?: string;
2600
+ /**
2601
+ * @brief 视频为加密视频时的加密类型
2602
+ * @default -
2603
+ */
2604
+ drmType?: EDRMTYPE;
2543
2605
  /** {zh}
2544
2606
  * @hidden
2545
2607
  */
@@ -2583,21 +2645,6 @@ export interface Current extends Partial<Stream> {
2583
2645
  * @default -
2584
2646
  */
2585
2647
  lineId?: number | string;
2586
- /**
2587
- * @brief 视频编码格式
2588
- * @default unknown
2589
- */
2590
- codec?: CodecType;
2591
- /**
2592
- * @brief 视频为加密视频时的密钥KeyId
2593
- * @default -
2594
- */
2595
- kid?: string;
2596
- /**
2597
- * @brief 视频为加密视频时的加密类型
2598
- * @default -
2599
- */
2600
- drmType?: EDRMTYPE;
2601
2648
  /**
2602
2649
  * @brief 地址的过期时间戳,vid模式下不用输入,播放器自动获取。如果是火山引擎的CDN分发地址,在不传入过期时间戳时,则需指定urlType,支持{@link https://www.volcengine.com/docs/4/177191 A-E类型},其他云厂商或者业务服务器存储的地址不支持。
2603
2650
  * @default -
@@ -2672,6 +2719,24 @@ export interface IPlayerConfig extends IPlayerOptions {
2672
2719
  * @memberof IPlayerConfig
2673
2720
  */
2674
2721
  getVideoByToken?: IPlayAuthTokenConfig;
2722
+ /** {zh}
2723
+ * @brief 视频加密类型
2724
+ * @default -
2725
+ */
2726
+ drmType?: EDRMTYPE;
2727
+ /** {zh}
2728
+ * @brief 私有加密会话id
2729
+ */
2730
+ encryptSessionId?: string;
2731
+ /**
2732
+ * @brief 视频为加密视频时的密钥KeyId,对应{@link https://www.volcengine.com/docs/4/2918 GetPlayInfo} 接口返回的PlayInfoList项中的 PlayAuthId
2733
+ * @default -
2734
+ */
2735
+ playAuthId?: string;
2736
+ /** {zh}
2737
+ * @brief 私有加密播放的加密密钥,对应{@link https://www.volcengine.com/docs/4/2918 GetPlayInfo} 接口返回的PlayInfoList项中的 PlayAuth
2738
+ */
2739
+ playAuth?: string;
2675
2740
  /** {zh}
2676
2741
  * @brief 视频格式。取值如下:
2677
2742
  * - `mp4`
@@ -2811,7 +2876,7 @@ export interface IPlayerConfig extends IPlayerOptions {
2811
2876
  * @listtip - 在已知视频编码方式的情况下推荐传入,以便日志分析。
2812
2877
  * - 在 `useSoftDecoding` 参数为 `true`(开启 H.265 兼容降级模式)时,建议传入,可提升软解初始效率。
2813
2878
  */
2814
- codec?: `${CodecType}`;
2879
+ codec?: ICodecType;
2815
2880
  /** {zh}
2816
2881
  * @brief 点播服务所在区域,影响服务接口和日志上报
2817
2882
  * @default cn
@@ -3530,6 +3595,27 @@ export interface definitionItem {
3530
3595
  */
3531
3596
  definitionTextKey?: string;
3532
3597
  }
3598
+ /** {zh}
3599
+ * @brief 可扩展插件结构
3600
+ */
3601
+ export interface EventPlugin {
3602
+ pluginName: string;
3603
+ type?: "inner" | "normal" | string;
3604
+ position?: string;
3605
+ icon?: string;
3606
+ index?: number;
3607
+ tips?: Transition;
3608
+ hideAtFullScreen?: boolean;
3609
+ }
3610
+ /** {zh}
3611
+ * @brief 多语言翻译结构体
3612
+ */
3613
+ export interface Transition {
3614
+ jp?: string;
3615
+ en?: string;
3616
+ zh?: string;
3617
+ "zh-hk"?: string;
3618
+ }
3533
3619
  /** {zh}
3534
3620
  * @brief 插件按钮位置
3535
3621
  */
@@ -3576,7 +3662,7 @@ export declare const enum POSITIONS {
3576
3662
  * @brief Plugin类插件基础配置
3577
3663
  */
3578
3664
  export interface IPluginConfig {
3579
- position?: typeof Plugin.POSITIONS[keyof typeof Plugin.POSITIONS];
3665
+ position?: (typeof Plugin.POSITIONS)[keyof typeof Plugin.POSITIONS];
3580
3666
  index?: number;
3581
3667
  disable?: boolean;
3582
3668
  }
@@ -3805,6 +3891,11 @@ export interface IThumbnailConfig {
3805
3891
  */
3806
3892
  hidePortrait?: false;
3807
3893
  }
3894
+ export interface ISourceConfig {
3895
+ url?: string;
3896
+ playList?: Stream[];
3897
+ getVideByToken?: IPlayAuthTokenConfig;
3898
+ }
3808
3899
  /**
3809
3900
  * @brief api map
3810
3901
  * @hidden
@@ -4153,6 +4244,166 @@ declare class VeStrategyWrapper {
4153
4244
  private initPreloaderConfig;
4154
4245
  }
4155
4246
  declare const _default: VeStrategyWrapper;
4247
+ declare enum UmdKeys {
4248
+ HLS = "hls",
4249
+ FLV = "flv",
4250
+ XGVideo = "XGVideo",
4251
+ HLSEncrypt = "hlsEncrypt",
4252
+ DASH = "dash",
4253
+ MP4Encrypt = "mp4Encrypt",
4254
+ DanmuJS = "danmujs",
4255
+ DanmuMask = "danmuMask",
4256
+ StreamProbe = "streamprobe",
4257
+ VeStrategy = "vestrategy",
4258
+ VeStrategyH265 = "vestrategy_h265",
4259
+ VeStrategyPreload = "vestrategy_preload",
4260
+ VeStrategyAdaptRange = "vestrategy_adapt_range",
4261
+ DashAbralgo = "DashAbralgo",
4262
+ Preloader = "preloader"
4263
+ }
4264
+ /**
4265
+ * @hidden
4266
+ * @breif umdmap 配置
4267
+ */
4268
+ export declare type UMDMap = Record<UmdKeys, {
4269
+ /**
4270
+ * umd Module 的名称,即在window下暴露的接口名称
4271
+ */
4272
+ name: string;
4273
+ /**
4274
+ * 对应umd文件名,只用来标记,实际不使用
4275
+ */
4276
+ pluginName?: string;
4277
+ /**
4278
+ * 对应npm包的名称,在打包文件时,会在libd.config.js中onPostBuild的钩子中会用于寻找对应npm包
4279
+ */
4280
+ packageName: string;
4281
+ /**
4282
+ * npm包中umd入口文件路径,用于打包上传到cdn目录
4283
+ */
4284
+ devPath: string;
4285
+ }>;
4286
+ declare class UMDLoader {
4287
+ private static jsLoadMap;
4288
+ private static jsLoadPromiseMap;
4289
+ umdMap: UMDMap;
4290
+ backupUmdUrlMap: Record<string, string>;
4291
+ failCallback: (umdName: string, err: any) => any;
4292
+ region: TRegionType;
4293
+ customPluginPublicPath: string;
4294
+ importedPlugins: any[];
4295
+ constructor();
4296
+ /**
4297
+ * @return { string } 插件加载的公共路径
4298
+ */
4299
+ get pluginPublicPath(): string;
4300
+ /**
4301
+ * 更新umd的备用地址
4302
+ * @param {Record<string, string>} map 备用地址map
4303
+ */
4304
+ updateBackupMap(map: Record<string, string>): void;
4305
+ /**
4306
+ * 加载额外的js-sdk
4307
+ * 适用 umd 模块
4308
+ * 只能浏览器环境下使用
4309
+ * @param url 额外加载JS 的 CDN 地址
4310
+ * @param isJs 是否js文件
4311
+ */
4312
+ loadExtraCdn(url: string, isJs?: boolean): Promise<void>;
4313
+ /**
4314
+ * @description 加载xgplayer插件
4315
+ * @param pluginName 插件名称
4316
+ * @param successCallback 加载完成后执行的回调
4317
+ * @return Promise<any>
4318
+ */
4319
+ loadPlugins(pluginName: UmdKeys, successCallback?: () => void): Promise<any>;
4320
+ }
4321
+ export declare class SdkPlugin {
4322
+ pluginName: string;
4323
+ __args: any;
4324
+ sdk: VePlayer;
4325
+ playerData: PlayerData;
4326
+ player: Player;
4327
+ _emitter: EventEmitter;
4328
+ static defineGetterOrSetter(Obj: any, map: any): void;
4329
+ /**
4330
+ * @type { string }
4331
+ */
4332
+ static get pluginName(): string;
4333
+ /**
4334
+ * @constructor
4335
+ * @param { { sdk: object, pluginName: string, [propName: string]: any;} } args
4336
+ */
4337
+ constructor(args: any);
4338
+ /**
4339
+ * @description sdk实例创建,挂载插件实例时首先执行
4340
+ */
4341
+ beforeCreate(): void;
4342
+ /**
4343
+ * @description sdk实例创建,挂载插件实例完后执行
4344
+ */
4345
+ afterCreate(): void;
4346
+ /**
4347
+ * @description sdk创建播放器前执行,只有这里能保证异步操作在creatPlayer之前同步完成
4348
+ */
4349
+ beforePlayerCreate(): void;
4350
+ /**
4351
+ * @description sdk创建播放器完执行
4352
+ */
4353
+ afterPlayerCreate(): void;
4354
+ /**
4355
+ * @description sdk销毁时执行
4356
+ */
4357
+ destroy(): void;
4358
+ /**
4359
+ * @private
4360
+ * @param { any } args
4361
+ */
4362
+ __init(args: any): void;
4363
+ /**
4364
+ * @description 插件销毁
4365
+ * @private
4366
+ */
4367
+ __destroy(): void;
4368
+ }
4369
+ declare class AuthToken extends SdkPlugin {
4370
+ static get pluginName(): string;
4371
+ isPlayByToken: boolean;
4372
+ isEncrypt: boolean;
4373
+ tokenInfo: ITokenInfo;
4374
+ keyTokenInfo: ITokenInfo;
4375
+ thirdPartyDrmAuthTokenInfo: ITokenInfo;
4376
+ config: IPlayAuthTokenConfig;
4377
+ privateDrmAuthToken: string;
4378
+ useUnionInfoDRM: boolean;
4379
+ sessionId: string;
4380
+ retryCount: number;
4381
+ playInfo?: VideoInfoRes;
4382
+ constructor(args: any);
4383
+ beforePlayerCreate(): Promise<void>;
4384
+ getVideoInfo(): Promise<{
4385
+ vid: string;
4386
+ playList: Stream[];
4387
+ codec: ICodecType;
4388
+ defaultDefinition: string;
4389
+ }>;
4390
+ getVideos(): Promise<any>;
4391
+ getPrivateDrmInfo(playList: Stream[], vid: string, streamType: string): Promise<void>;
4392
+ getThumbnailConfig(thumbs: IThumbInfoItem[]): void;
4393
+ getBarrageMaskUrl(url: string): void;
4394
+ getDrmConfig(videoInfo: IVideoInfo): void;
4395
+ init(): void;
4396
+ initConfig(getVideoByToken: IPlayAuthTokenConfig): void;
4397
+ /**
4398
+ * @description 更新playAuthToken
4399
+ * @param {IPlayAuthTokenConfig} getVideoByToken token信息
4400
+ * @param {boolean} isNewVideo 是否新视频,即是否为切换视频
4401
+ */
4402
+ updateAuthToken(getVideoByToken: IPlayAuthTokenConfig, isNewVideo: boolean): Promise<void>;
4403
+ checkPlayAuthTokenValid(): boolean;
4404
+ checkKeyTokenValid(): boolean;
4405
+ checkDrmAuthTokenValid(): boolean;
4406
+ }
4156
4407
  /** {zh}
4157
4408
  * @hidden
4158
4409
  */
@@ -4194,6 +4445,8 @@ declare abstract class AbstractBaseAdapter {
4194
4445
  abstract adaptRangeDefaultOptions(): IAdaptRangeDefaultOptions | undefined;
4195
4446
  abstract applyAdaptRangePluginConfig(_finalOptions: any, _adaptRangeOptions: any): void;
4196
4447
  abstract applyAdaptRangeStrategy(_finalOptions: any, _adaptRangeOptions: any): void;
4448
+ abstract getPlugins(umdLoader: UMDLoader): Promise<XGPlugin[]>;
4449
+ abstract setPluginConfigInVid(videoInfo: IVideoInfo, context: AuthToken): void;
4197
4450
  }
4198
4451
  declare class PlayerData {
4199
4452
  id?: string;
@@ -4209,7 +4462,7 @@ declare class PlayerData {
4209
4462
  openSoftDecoding: boolean;
4210
4463
  defaultConfig: IDefaultConfig | undefined;
4211
4464
  isHitDefault: boolean;
4212
- codec?: `${CodecType}`;
4465
+ codec?: ICodecType;
4213
4466
  enableH265Degrade: boolean;
4214
4467
  languageData: {
4215
4468
  extraLangList: IXGI18nText[];
@@ -4240,12 +4493,25 @@ declare class PlayerData {
4240
4493
  };
4241
4494
  private isAutoBitrateEnable;
4242
4495
  adapter: AbstractBaseAdapter;
4243
- isBusinessDrm: boolean;
4244
- isEncrypt: boolean;
4496
+ /**
4497
+ * @breif 是否vid模式的加密播放
4498
+ */
4499
+ isVidEncrypt: boolean;
4245
4500
  dashOpts: {
4246
4501
  Data: IGetPlayInfoRes;
4247
4502
  };
4503
+ /**
4504
+ * @brief 播放器sdk实例
4505
+ */
4248
4506
  sdk: VePlayer;
4507
+ /**
4508
+ * @brief 当前加密播放类型,为空则表示非加密
4509
+ */
4510
+ drmType: EDRMTYPE;
4511
+ /**
4512
+ * @brief 私有加密会话id
4513
+ */
4514
+ encryptSessionId?: string;
4249
4515
  constructor(configs: IPlayerConfig & {
4250
4516
  licensSupportModuleList: string[];
4251
4517
  }, sdk: VePlayer);
@@ -4262,6 +4528,7 @@ declare class PlayerData {
4262
4528
  playList: Stream[];
4263
4529
  };
4264
4530
  isCurrentH265(): boolean;
4531
+ setDrmType(drmType: EDRMTYPE): void;
4265
4532
  getCurrentByDefaultConfig(): Stream;
4266
4533
  initCurrent(currentStreams: Stream): void;
4267
4534
  initCheckExpireData(): void;
@@ -4374,80 +4641,6 @@ declare class MobilePlayerPanel {
4374
4641
  bind(event: string, eventHandle: any, isBubble?: boolean): void;
4375
4642
  destroy(): void;
4376
4643
  }
4377
- declare enum UmdKeys {
4378
- HLS = "hls",
4379
- FLV = "flv",
4380
- XGVideo = "XGVideo",
4381
- HLSEncrypt = "hlsEncrypt",
4382
- DASH = "dash",
4383
- MP4Encrypt = "mp4Encrypt",
4384
- DanmuJS = "danmujs",
4385
- DanmuMask = "danmuMask",
4386
- StreamProbe = "streamprobe",
4387
- VeStrategy = "vestrategy",
4388
- VeStrategyH265 = "vestrategy_h265",
4389
- VeStrategyPreload = "vestrategy_preload",
4390
- VeStrategyAdaptRange = "vestrategy_adapt_range",
4391
- DashAbralgo = "DashAbralgo",
4392
- Preloader = "preloader"
4393
- }
4394
- /**
4395
- * @hidden
4396
- * @breif umdmap 配置
4397
- */
4398
- export declare type UMDMap = Record<UmdKeys, {
4399
- /**
4400
- * umd Module 的名称,即在window下暴露的接口名称
4401
- */
4402
- name: string;
4403
- /**
4404
- * 对应umd文件名,只用来标记,实际不使用
4405
- */
4406
- pluginName?: string;
4407
- /**
4408
- * 对应npm包的名称,在打包文件时,会在libd.config.js中onPostBuild的钩子中会用于寻找对应npm包
4409
- */
4410
- packageName: string;
4411
- /**
4412
- * npm包中umd入口文件路径,用于打包上传到cdn目录
4413
- */
4414
- devPath: string;
4415
- }>;
4416
- declare class umdLoader {
4417
- private static jsLoadMap;
4418
- private static jsLoadPromiseMap;
4419
- umdMap: UMDMap;
4420
- backupUmdUrlMap: Record<string, string>;
4421
- failCallback: (umdName: string, err: any) => any;
4422
- region: TRegionType;
4423
- customPluginPublicPath: string;
4424
- importedPlugins: any[];
4425
- constructor();
4426
- /**
4427
- * @return { string } 插件加载的公共路径
4428
- */
4429
- get pluginPublicPath(): string;
4430
- /**
4431
- * 更新umd的备用地址
4432
- * @param {Record<string, string>} map 备用地址map
4433
- */
4434
- updateBackupMap(map: Record<string, string>): void;
4435
- /**
4436
- * 加载额外的js-sdk
4437
- * 适用 umd 模块
4438
- * 只能浏览器环境下使用
4439
- * @param url 额外加载JS 的 CDN 地址
4440
- * @param isJs 是否js文件
4441
- */
4442
- loadExtraCdn(url: string, isJs?: boolean): Promise<void>;
4443
- /**
4444
- * @description 加载xgplayer插件
4445
- * @param pluginName 插件名称
4446
- * @param successCallback 加载完成后执行的回调
4447
- * @return Promise<any>
4448
- */
4449
- loadPlugins(pluginName: UmdKeys, successCallback?: () => void): Promise<any>;
4450
- }
4451
4644
  export interface IlicenseContent {
4452
4645
  content: string;
4453
4646
  sign: string;
@@ -4496,6 +4689,23 @@ export declare type PlayerCore = Player & {
4496
4689
  licenseType: LicenseEdition;
4497
4690
  };
4498
4691
  };
4692
+ /**
4693
+ * @brief 加密混淆信息
4694
+ */
4695
+ export interface EncryptInfo {
4696
+ /**
4697
+ * @breif 会话ID
4698
+ */
4699
+ sessionId: string;
4700
+ /**
4701
+ * @brief 混淆后的公钥
4702
+ */
4703
+ drmKeK: string;
4704
+ /**
4705
+ * @breif 唯一身份信息
4706
+ */
4707
+ unionInfo: string;
4708
+ }
4499
4709
  declare class VePlayer {
4500
4710
  /** {zh}
4501
4711
  * @brief 播放相关配置数据
@@ -4598,7 +4808,7 @@ declare class VePlayer {
4598
4808
  * @type {*}
4599
4809
  * @memberof VePlayer
4600
4810
  */
4601
- sdkUmdLoader: umdLoader;
4811
+ sdkUmdLoader: UMDLoader;
4602
4812
  private adapter;
4603
4813
  /**
4604
4814
  * @hidden
@@ -4618,10 +4828,16 @@ declare class VePlayer {
4618
4828
  * @memberof VePlayer
4619
4829
  */
4620
4830
  static sdkVersion: string;
4831
+ /**
4832
+ * @hidden
4833
+ * @private 私有加密会话id
4834
+ */
4835
+ private static privateEncryptSessionId;
4621
4836
  /**
4622
4837
  * @hidden
4623
4838
  */
4624
4839
  private veErrorIns;
4840
+ private vodLogCommon;
4625
4841
  /** {zh}
4626
4842
  * @brief 播放策略预初始化配置
4627
4843
  * @param options 初始化配置,详情见{@link StrategyInitOptions}
@@ -4668,7 +4884,12 @@ declare class VePlayer {
4668
4884
  static checkModuleList(): Promise<string[]>;
4669
4885
  static checkLicenseStatus(): Promise<LicenseStatus>;
4670
4886
  static checkLicenseModuleAuth(module: string, featureName: LicenseFeature): Promise<boolean>;
4671
- private static vodLogCommon;
4887
+ /**
4888
+ * @breif 生成加密混淆的数据信息
4889
+ * @param unionId 用户唯一id
4890
+ * @param streamType 私有加密视频的格式/协议,取值有:hls、mp4、dash。
4891
+ */
4892
+ static generateEncryptInfo(unionId: string, streamType: "hls" | "mp4" | "dash"): Promise<EncryptInfo | undefined>;
4672
4893
  private static hasInitVeStrategy;
4673
4894
  /**
4674
4895
  * @hidden
@@ -4711,10 +4932,16 @@ declare class VePlayer {
4711
4932
  private _initCheckExpire;
4712
4933
  /**
4713
4934
  * @hidden
4714
- * @description 更新umdLoader 的配置
4935
+ * @description 初始化umdLoader 的配置
4715
4936
  * @memberof VePlayer
4716
4937
  */
4717
4938
  private initUmdLoader;
4939
+ /**
4940
+ * @hidden
4941
+ * @description 更新umdLoader 的配置
4942
+ * @memberof VePlayer
4943
+ */
4944
+ private updateUmdLoader;
4718
4945
  /**
4719
4946
  * @hidden
4720
4947
  * @private
@@ -4774,7 +5001,10 @@ declare class VePlayer {
4774
5001
  /** {en}
4775
5002
  * @hidden
4776
5003
  */
4777
- renderDom(): void;
5004
+ renderDom({ id, root }: {
5005
+ id: any;
5006
+ root: any;
5007
+ }): void;
4778
5008
  /** {zh}
4779
5009
  * @hidden
4780
5010
  *
@@ -5061,7 +5291,7 @@ declare class VePlayer {
5061
5291
  getSoftDecodingOption(isOpenSoftDecoding: boolean, url: string, type: string): Promise<{
5062
5292
  mediaType?: string;
5063
5293
  innerDegrade?: number;
5064
- codecType?: `${CodecType}`;
5294
+ codecType?: ICodecType;
5065
5295
  plugins?: any[];
5066
5296
  }>;
5067
5297
  /** {zh}
@@ -5782,54 +6012,6 @@ export declare class LiveInfoPanel extends Plugin {
5782
6012
  close(): void;
5783
6013
  render(): string;
5784
6014
  }
5785
- export declare class SdkPlugin {
5786
- pluginName: string;
5787
- __args: any;
5788
- sdk: VePlayer;
5789
- playerData: PlayerData;
5790
- player: Player;
5791
- _emitter: EventEmitter;
5792
- static defineGetterOrSetter(Obj: any, map: any): void;
5793
- /**
5794
- * @type { string }
5795
- */
5796
- static get pluginName(): string;
5797
- /**
5798
- * @constructor
5799
- * @param { { sdk: object, pluginName: string, [propName: string]: any;} } args
5800
- */
5801
- constructor(args: any);
5802
- /**
5803
- * @description sdk实例创建,挂载插件实例时首先执行
5804
- */
5805
- beforeCreate(): void;
5806
- /**
5807
- * @description sdk实例创建,挂载插件实例完后执行
5808
- */
5809
- afterCreate(): void;
5810
- /**
5811
- * @description sdk创建播放器前执行,只有这里能保证异步操作在creatPlayer之前同步完成
5812
- */
5813
- beforePlayerCreate(): void;
5814
- /**
5815
- * @description sdk创建播放器完执行
5816
- */
5817
- afterPlayerCreate(): void;
5818
- /**
5819
- * @description sdk销毁时执行
5820
- */
5821
- destroy(): void;
5822
- /**
5823
- * @private
5824
- * @param { any } args
5825
- */
5826
- __init(args: any): void;
5827
- /**
5828
- * @description 插件销毁
5829
- * @private
5830
- */
5831
- __destroy(): void;
5832
- }
5833
6015
  export declare const Events: {
5834
6016
  /** {zh}
5835
6017
  * @brief 弹幕配置发生变化。