@volcengine/veplayer 1.12.0-rc.2 → 1.12.0-rc.4

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
@@ -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 Whether to enable barrage by default
281
281
  */
282
282
  usePanel?: boolean;
283
283
  /**
@@ -295,11 +295,13 @@ export interface IDanmuConfig {
295
295
  */
296
296
  external?: ExternalItem[];
297
297
  /**
298
- * @hidden
298
+ * @brief 蒙版弹幕配置
299
+ * @default -
299
300
  */
300
301
  maskConfig?: IMaskConfig;
301
302
  /**
302
- * @hidden
303
+ * @brief 是否开启蒙版弹幕,即对应智能挡板开关
304
+ * @default false
303
305
  */
304
306
  maskActive?: boolean;
305
307
  }
@@ -1574,6 +1576,11 @@ export interface IStartConfig {
1574
1576
  */
1575
1577
  mode?: "hide" | "show" | "auto";
1576
1578
  }
1579
+ /**
1580
+ * @hidden
1581
+ * @brief 西瓜插件
1582
+ */
1583
+ export declare type XGPlugin = typeof Plugin | typeof BasePlugin;
1577
1584
  /**
1578
1585
  * @brief 自动播放配置。
1579
1586
  * @list Options
@@ -2118,14 +2125,9 @@ export declare class MemoryPlay extends Plugin {
2118
2125
  getTimeByStorage(memoryId: string): string | 0;
2119
2126
  destroy(): void;
2120
2127
  }
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"
2128
+ export interface IVolume {
2129
+ Loudness: number;
2130
+ Peak: number;
2129
2131
  }
2130
2132
  /** {zh}
2131
2133
  * @hidden
@@ -2136,7 +2138,7 @@ export interface IPlayInfoListItem {
2136
2138
  BarrageMaskOffset: string;
2137
2139
  Bitrate: number;
2138
2140
  CheckInfo: string;
2139
- Codec: CodecType;
2141
+ Codec: ICodecType;
2140
2142
  Definition: string;
2141
2143
  Duration: number;
2142
2144
  FileId: string;
@@ -2241,55 +2243,62 @@ export interface IGetPlayInfoRes {
2241
2243
  TotalCount: number;
2242
2244
  Version: number;
2243
2245
  }
2244
- /**
2245
- * @author bytedance
2246
- * @version 1.0
2247
- * @Description
2248
- * @date 2024/5/17 15:53
2249
- */
2250
2246
  /** {zh}
2251
2247
  * @list Options
2252
2248
  * @brief 视频编码格式。
2253
2249
  */
2254
- export declare const enum CodecType {
2250
+ export declare const CodecType: {
2255
2251
  /** {zh}
2256
2252
  * @brief H.264
2257
2253
  */
2258
- H264 = "h264",
2254
+ readonly H264: "h264";
2259
2255
  /** {zh}
2260
2256
  * @brief H.265
2261
2257
  */
2262
- H265 = "h265",
2258
+ readonly H265: "h265";
2263
2259
  /** {zh}
2264
2260
  * @brief H.266
2265
2261
  */
2266
- H266 = "h266",
2262
+ readonly H266: "h266";
2267
2263
  /** {zh}
2268
2264
  * @brief 音频 AAC,含 heaacv2
2269
2265
  */
2270
- AAC = "aac",
2266
+ readonly AAC: "aac";
2271
2267
  /** {zh}
2272
2268
  * @brief 音频 MP3
2273
2269
  */
2274
- MP3 = "mp3",
2270
+ readonly MP3: "mp3";
2275
2271
  /** {zh}
2276
2272
  * @brief 音频 OPUS
2277
2273
  */
2278
- OPUS = "opus",
2274
+ readonly OPUS: "opus";
2279
2275
  /** {zh}
2280
2276
  * @brief 未知编码格式
2281
2277
  */
2282
- UNKNOWN = "unknown"
2283
- }
2284
- declare enum RTMCodec {
2278
+ readonly UNKNOWN: "unknown";
2279
+ };
2280
+ export declare type ICodecType = (typeof CodecType)[keyof typeof CodecType];
2281
+ export declare const ContentType: {
2282
+ h265: string;
2283
+ h264: string;
2284
+ };
2285
+ export declare enum RTMCodec {
2285
2286
  H264 = "h264"
2286
2287
  }
2287
- declare enum EVideoFormat {
2288
+ /** {zh}
2289
+ * @hidden
2290
+ * @brief 音频封装格式
2291
+ */
2292
+ export declare enum EVideoFormat {
2288
2293
  MP4 = "mp4",
2289
2294
  DASH = "dash",
2290
2295
  HLS = "hls"
2291
2296
  }
2292
- declare enum EAudioFormat {
2297
+ /** {zh}
2298
+ * @hidden
2299
+ * @brief 视频封装格式
2300
+ */
2301
+ export declare enum EAudioFormat {
2293
2302
  M4A = "m4a",
2294
2303
  MP4 = "mp4",
2295
2304
  MP3 = "mp3",
@@ -2297,6 +2306,45 @@ declare enum EAudioFormat {
2297
2306
  HLS = "hls",
2298
2307
  OGG = "ogg"
2299
2308
  }
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";
2300
2348
  /** {zh}
2301
2349
  * @brief 区域类型:
2302
2350
  * - `'cn'`:中国内地
@@ -2492,7 +2540,7 @@ export interface Stream extends Partial<IPlayInfoListItem> {
2492
2540
  * @brief 编码格式
2493
2541
  * @default unknown
2494
2542
  */
2495
- codec?: CodecType;
2543
+ codec?: ICodecType;
2496
2544
  /** {zh}
2497
2545
  * @brief 线路唯一 ID
2498
2546
  */
@@ -2538,6 +2586,20 @@ export interface Stream extends Partial<IPlayInfoListItem> {
2538
2586
  * @default -
2539
2587
  */
2540
2588
  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;
2541
2603
  /** {zh}
2542
2604
  * @hidden
2543
2605
  */
@@ -2581,21 +2643,6 @@ export interface Current extends Partial<Stream> {
2581
2643
  * @default -
2582
2644
  */
2583
2645
  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;
2599
2646
  /**
2600
2647
  * @brief 地址的过期时间戳,vid模式下不用输入,播放器自动获取。如果是火山引擎的CDN分发地址,在不传入过期时间戳时,则需指定urlType,支持{@link https://www.volcengine.com/docs/4/177191 A-E类型},其他云厂商或者业务服务器存储的地址不支持。
2601
2648
  * @default -
@@ -2670,6 +2717,24 @@ export interface IPlayerConfig extends IPlayerOptions {
2670
2717
  * @memberof IPlayerConfig
2671
2718
  */
2672
2719
  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;
2673
2738
  /** {zh}
2674
2739
  * @brief 视频格式。取值如下:
2675
2740
  * - `mp4`
@@ -2809,7 +2874,7 @@ export interface IPlayerConfig extends IPlayerOptions {
2809
2874
  * @listtip - 在已知视频编码方式的情况下推荐传入,以便日志分析。
2810
2875
  * - 在 `useSoftDecoding` 参数为 `true`(开启 H.265 兼容降级模式)时,建议传入,可提升软解初始效率。
2811
2876
  */
2812
- codec?: `${CodecType}`;
2877
+ codec?: ICodecType;
2813
2878
  /** {zh}
2814
2879
  * @brief 点播服务所在区域,影响服务接口和日志上报
2815
2880
  * @default cn
@@ -3528,6 +3593,27 @@ export interface definitionItem {
3528
3593
  */
3529
3594
  definitionTextKey?: string;
3530
3595
  }
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
+ }
3531
3617
  /** {zh}
3532
3618
  * @brief 插件按钮位置
3533
3619
  */
@@ -3574,7 +3660,7 @@ export declare const enum POSITIONS {
3574
3660
  * @brief Plugin类插件基础配置
3575
3661
  */
3576
3662
  export interface IPluginConfig {
3577
- position?: typeof Plugin.POSITIONS[keyof typeof Plugin.POSITIONS];
3663
+ position?: (typeof Plugin.POSITIONS)[keyof typeof Plugin.POSITIONS];
3578
3664
  index?: number;
3579
3665
  disable?: boolean;
3580
3666
  }
@@ -3803,6 +3889,11 @@ export interface IThumbnailConfig {
3803
3889
  */
3804
3890
  hidePortrait?: false;
3805
3891
  }
3892
+ export interface ISourceConfig {
3893
+ url?: string;
3894
+ playList?: Stream[];
3895
+ getVideByToken?: IPlayAuthTokenConfig;
3896
+ }
3806
3897
  /**
3807
3898
  * @brief api map
3808
3899
  * @hidden
@@ -4151,6 +4242,166 @@ declare class VeStrategyWrapper {
4151
4242
  private initPreloaderConfig;
4152
4243
  }
4153
4244
  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
+ }
4154
4405
  /** {zh}
4155
4406
  * @hidden
4156
4407
  */
@@ -4192,6 +4443,8 @@ declare abstract class AbstractBaseAdapter {
4192
4443
  abstract adaptRangeDefaultOptions(): IAdaptRangeDefaultOptions | undefined;
4193
4444
  abstract applyAdaptRangePluginConfig(_finalOptions: any, _adaptRangeOptions: any): void;
4194
4445
  abstract applyAdaptRangeStrategy(_finalOptions: any, _adaptRangeOptions: any): void;
4446
+ abstract getPlugins(umdLoader: UMDLoader): Promise<XGPlugin[]>;
4447
+ abstract setPluginConfigInVid(videoInfo: IVideoInfo, context: AuthToken): void;
4195
4448
  }
4196
4449
  declare class PlayerData {
4197
4450
  id?: string;
@@ -4207,7 +4460,7 @@ declare class PlayerData {
4207
4460
  openSoftDecoding: boolean;
4208
4461
  defaultConfig: IDefaultConfig | undefined;
4209
4462
  isHitDefault: boolean;
4210
- codec?: `${CodecType}`;
4463
+ codec?: ICodecType;
4211
4464
  enableH265Degrade: boolean;
4212
4465
  languageData: {
4213
4466
  extraLangList: IXGI18nText[];
@@ -4238,12 +4491,25 @@ declare class PlayerData {
4238
4491
  };
4239
4492
  private isAutoBitrateEnable;
4240
4493
  adapter: AbstractBaseAdapter;
4241
- isBusinessDrm: boolean;
4242
- isEncrypt: boolean;
4494
+ /**
4495
+ * @breif 是否vid模式的加密播放
4496
+ */
4497
+ isVidEncrypt: boolean;
4243
4498
  dashOpts: {
4244
4499
  Data: IGetPlayInfoRes;
4245
4500
  };
4501
+ /**
4502
+ * @brief 播放器sdk实例
4503
+ */
4246
4504
  sdk: VePlayer;
4505
+ /**
4506
+ * @brief 当前加密播放类型,为空则表示非加密
4507
+ */
4508
+ drmType?: EDRMTYPE;
4509
+ /**
4510
+ * @brief 私有加密会话id
4511
+ */
4512
+ encryptSessionId?: string;
4247
4513
  constructor(configs: IPlayerConfig & {
4248
4514
  licensSupportModuleList: string[];
4249
4515
  }, sdk: VePlayer);
@@ -4260,6 +4526,7 @@ declare class PlayerData {
4260
4526
  playList: Stream[];
4261
4527
  };
4262
4528
  isCurrentH265(): boolean;
4529
+ setDrmType(drmType: EDRMTYPE): void;
4263
4530
  getCurrentByDefaultConfig(): Stream;
4264
4531
  initCurrent(currentStreams: Stream): void;
4265
4532
  initCheckExpireData(): void;
@@ -4372,80 +4639,6 @@ declare class MobilePlayerPanel {
4372
4639
  bind(event: string, eventHandle: any, isBubble?: boolean): void;
4373
4640
  destroy(): void;
4374
4641
  }
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
- }
4449
4642
  export interface IlicenseContent {
4450
4643
  content: string;
4451
4644
  sign: string;
@@ -4494,6 +4687,23 @@ export declare type PlayerCore = Player & {
4494
4687
  licenseType: LicenseEdition;
4495
4688
  };
4496
4689
  };
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
+ }
4497
4707
  declare class VePlayer {
4498
4708
  /** {zh}
4499
4709
  * @brief 播放相关配置数据
@@ -4596,7 +4806,7 @@ declare class VePlayer {
4596
4806
  * @type {*}
4597
4807
  * @memberof VePlayer
4598
4808
  */
4599
- sdkUmdLoader: umdLoader;
4809
+ sdkUmdLoader: UMDLoader;
4600
4810
  private adapter;
4601
4811
  /**
4602
4812
  * @hidden
@@ -4616,10 +4826,16 @@ declare class VePlayer {
4616
4826
  * @memberof VePlayer
4617
4827
  */
4618
4828
  static sdkVersion: string;
4829
+ /**
4830
+ * @hidden
4831
+ * @private 私有加密会话id
4832
+ */
4833
+ private static privateEncryptSessionId;
4619
4834
  /**
4620
4835
  * @hidden
4621
4836
  */
4622
4837
  private veErrorIns;
4838
+ private vodLogCommon;
4623
4839
  /** {zh}
4624
4840
  * @brief 播放策略预初始化配置
4625
4841
  * @param options 初始化配置,详情见{@link StrategyInitOptions}
@@ -4666,7 +4882,12 @@ declare class VePlayer {
4666
4882
  static checkModuleList(): Promise<string[]>;
4667
4883
  static checkLicenseStatus(): Promise<LicenseStatus>;
4668
4884
  static checkLicenseModuleAuth(module: string, featureName: LicenseFeature): Promise<boolean>;
4669
- private static vodLogCommon;
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>;
4670
4891
  private static hasInitVeStrategy;
4671
4892
  /**
4672
4893
  * @hidden
@@ -4709,10 +4930,16 @@ declare class VePlayer {
4709
4930
  private _initCheckExpire;
4710
4931
  /**
4711
4932
  * @hidden
4712
- * @description 更新umdLoader 的配置
4933
+ * @description 初始化umdLoader 的配置
4713
4934
  * @memberof VePlayer
4714
4935
  */
4715
4936
  private initUmdLoader;
4937
+ /**
4938
+ * @hidden
4939
+ * @description 更新umdLoader 的配置
4940
+ * @memberof VePlayer
4941
+ */
4942
+ private updateUmdLoader;
4716
4943
  /**
4717
4944
  * @hidden
4718
4945
  * @private
@@ -5059,7 +5286,7 @@ declare class VePlayer {
5059
5286
  getSoftDecodingOption(isOpenSoftDecoding: boolean, url: string, type: string): Promise<{
5060
5287
  mediaType?: string;
5061
5288
  innerDegrade?: number;
5062
- codecType?: `${CodecType}`;
5289
+ codecType?: ICodecType;
5063
5290
  plugins?: any[];
5064
5291
  }>;
5065
5292
  /** {zh}
@@ -5727,54 +5954,6 @@ export declare class LiveInfoPanel extends Plugin {
5727
5954
  close(): void;
5728
5955
  render(): string;
5729
5956
  }
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
- }
5778
5957
  export declare const Events: {
5779
5958
  /** {zh}
5780
5959
  * @brief 弹幕配置发生变化。