@volcengine/veplayer 1.9.2 → 1.10.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
@@ -2053,18 +2053,21 @@ export declare class MemoryPlay extends Plugin {
2053
2053
  getTimeByStorage(memoryId: string): string | 0;
2054
2054
  destroy(): void;
2055
2055
  }
2056
+ declare enum EDRMTYPE {
2057
+ DRM_ENCRYPT = "drm_encrypt"
2058
+ }
2056
2059
  export interface IPlayInfoListItem {
2057
2060
  BackupPlayUrl: string;
2058
2061
  BackupUrlExpire: string;
2059
2062
  BarrageMaskOffset: string;
2060
2063
  Bitrate: number;
2061
2064
  CheckInfo: string;
2062
- Codec: string;
2065
+ Codec: CodecType;
2063
2066
  Definition: string;
2064
2067
  Duration: number;
2065
2068
  FileId: string;
2066
2069
  FileType: string;
2067
- Format: string;
2070
+ Format: EVideoFormat | EAudioFormat;
2068
2071
  Height: number;
2069
2072
  IndexRange: string;
2070
2073
  InitRange: string;
@@ -2079,16 +2082,85 @@ export interface IPlayInfoListItem {
2079
2082
  Size: number;
2080
2083
  Volume?: number;
2081
2084
  Width: number;
2085
+ DrmType?: EDRMTYPE;
2086
+ }
2087
+ export interface ISubtitleInfoList {
2088
+ CreateTime: string;
2089
+ FileId: string;
2090
+ Format: string;
2091
+ Language: string;
2092
+ LanguageId: number;
2093
+ Source: string;
2094
+ Status: string;
2095
+ StoreUri: string;
2096
+ SubtitleId: string;
2097
+ SubtitleUrl: string;
2098
+ Tag: string;
2099
+ Title: string;
2100
+ Version: string;
2101
+ Vid: string;
2102
+ }
2103
+ export interface IThumbInfoList {
2104
+ CaptureNum: number;
2105
+ CellHeight: number;
2106
+ CellWidth: number;
2107
+ Format: string;
2108
+ ImgXLen: number;
2109
+ ImgYLen: number;
2110
+ Interval: number;
2111
+ StoreUrls: string[];
2112
+ }
2113
+ export interface IBarrageMaskInfo {
2114
+ Version: string;
2115
+ BarrageMaskUrl: string;
2116
+ FileId: string;
2117
+ FileSize: number;
2118
+ FileHash: string;
2119
+ UpdatedAt: string;
2120
+ Bitrate: number;
2121
+ HeadLen: number;
2122
+ }
2123
+ export interface IGetPlayInfoRes {
2124
+ Vid: string;
2125
+ AdaptiveInfo?: any;
2126
+ BarrageMaskInfo?: IBarrageMaskInfo;
2127
+ BarrageMaskUrl: string;
2128
+ Duration: number;
2129
+ EnableAdaptive: boolean;
2130
+ FileType: string;
2131
+ PlayInfoList: IPlayInfoListItem[];
2132
+ PosterUrl: string;
2133
+ Status: number;
2134
+ SubtitleInfoList: ISubtitleInfoList[];
2135
+ ThumbInfoList: IThumbInfoList[];
2136
+ TotalCount: number;
2137
+ Version: number;
2082
2138
  }
2083
2139
  declare enum CodecType {
2140
+ /** {zh}
2141
+ * @brief H.264
2142
+ */
2143
+ H264 = "h264",
2084
2144
  /** {zh}
2085
2145
  * @brief H.265
2086
2146
  */
2087
2147
  H265 = "h265",
2088
2148
  /** {zh}
2089
- * @brief H.264
2149
+ * @brief H.266
2090
2150
  */
2091
- H264 = "h264",
2151
+ H266 = "h266",
2152
+ /** {zh}
2153
+ * @brief 音频AAC,含 heaacv2
2154
+ */
2155
+ AAC = "aac",
2156
+ /** {zh}
2157
+ * @brief 音频MP3
2158
+ */
2159
+ MP3 = "mp3",
2160
+ /** {zh}
2161
+ * @brief 音频OPUS
2162
+ */
2163
+ OPUS = "opus",
2092
2164
  /** {zh}
2093
2165
  * @brief 未知编码格式
2094
2166
  */
@@ -2097,6 +2169,19 @@ declare enum CodecType {
2097
2169
  declare enum RTMCodec {
2098
2170
  H264 = "h264"
2099
2171
  }
2172
+ declare enum EVideoFormat {
2173
+ MP4 = "mp4",
2174
+ DASH = "dash",
2175
+ HLS = "hls"
2176
+ }
2177
+ declare enum EAudioFormat {
2178
+ M4A = "m4a",
2179
+ MP4 = "mp4",
2180
+ MP3 = "mp3",
2181
+ DASH = "dash",
2182
+ HLS = "hls",
2183
+ OGG = "ogg"
2184
+ }
2100
2185
  /** {zh}
2101
2186
  * @brief 区域类型:
2102
2187
  * - `'cn'`:中国内地
@@ -2350,12 +2435,42 @@ export interface Condition {
2350
2435
  /** {en}
2351
2436
  * @hidden
2352
2437
  */
2353
- export interface Current {
2438
+ export interface Current extends Partial<Stream> {
2439
+ /**
2440
+ * @brief 清晰度
2441
+ * @default -
2442
+ */
2354
2443
  definition: string;
2444
+ /**
2445
+ * @brief 视频格式/协议
2446
+ * @default -
2447
+ */
2355
2448
  streamType: string;
2449
+ /**
2450
+ * @brief 视频流语言
2451
+ * @default -
2452
+ */
2356
2453
  language: string;
2454
+ /**
2455
+ * @brief 视频流id
2456
+ * @default -
2457
+ */
2357
2458
  lineId?: number | string;
2459
+ /**
2460
+ * @brief 视频编码格式
2461
+ * @default unknown
2462
+ */
2358
2463
  codec?: CodecType;
2464
+ /**
2465
+ * @brief 视频为加密视频时的密钥KeyId
2466
+ * @default -
2467
+ */
2468
+ kid?: string;
2469
+ /**
2470
+ * @brief 视频为加密视频时的加密类型
2471
+ * @default -
2472
+ */
2473
+ drmType?: string;
2359
2474
  /**
2360
2475
  * @brief 地址的过期时间戳,vid模式下不用输入,播放器自动获取。如果是火山引擎的CDN分发地址,在不传入过期时间戳时,则需指定urlType,支持{@link https://www.volcengine.com/docs/4/177191 A-E类型},其他云厂商或者业务服务器存储的地址不支持。
2361
2476
  * @default -
@@ -3126,6 +3241,22 @@ export interface IPlayAuthTokenConfig {
3126
3241
  * @default -
3127
3242
  */
3128
3243
  getDrmAuthToken?: (playAuthIds: string, vid: string, unionInfo: string) => Promise<string>;
3244
+ /**
3245
+ * @brief 商业DRM 获取license的token
3246
+ * @default -
3247
+ */
3248
+ thirdPartyDrmAuthToken?: string;
3249
+ /**
3250
+ * @brief 商业DRM,获取fairplay证书的地址
3251
+ * @default -
3252
+ */
3253
+ serverCertificatePath?: string;
3254
+ /**
3255
+ * @brief 商业DRM播放时,是否开启防录屏
3256
+ * @notice 如果开启后,但当前环境不支持,则报错
3257
+ * @default true
3258
+ */
3259
+ unRecord?: boolean;
3129
3260
  /** {zh}
3130
3261
  * @brief 可携带aid等透传参数,如:
3131
3262
  * {aid: 1234},以playAuthToken下发的参数的优先级最高。
@@ -3679,7 +3810,7 @@ declare const _default: VeStrategyWrapper;
3679
3810
  declare class PlayerData {
3680
3811
  id?: string;
3681
3812
  root?: HTMLElement;
3682
- configs: any;
3813
+ configs: IPlayerConfig;
3683
3814
  strategyConfig?: StrategyConfigOptions;
3684
3815
  type: string;
3685
3816
  isLive: boolean;
@@ -3719,6 +3850,11 @@ declare class PlayerData {
3719
3850
  urlExpireDiff: number;
3720
3851
  urlCheckExpireInterval: number;
3721
3852
  };
3853
+ isBusinessDrm: boolean;
3854
+ isEncrypt: boolean;
3855
+ dashOpts: {
3856
+ Data: IGetPlayInfoRes;
3857
+ };
3722
3858
  constructor(configs: IPlayerConfig);
3723
3859
  /**
3724
3860
  * 初始化播放数据
@@ -3745,12 +3881,12 @@ declare class PlayerData {
3745
3881
  /**
3746
3882
  * @description: 获取当前的streamType
3747
3883
  */
3748
- getCurrentStreamType(): any;
3749
- getStreamType(): any;
3884
+ getCurrentStreamType(): string;
3885
+ getStreamType(): string;
3750
3886
  isOpenABR(streamType?: string): boolean;
3751
3887
  showRealDefinition(): boolean;
3752
3888
  isAutoDefinition(def: any): boolean;
3753
- isPlayAutoDefinition(def?: string): any;
3889
+ isPlayAutoDefinition(def?: string): boolean;
3754
3890
  isDefinitionMatch(pre: any, next: any): boolean;
3755
3891
  /**
3756
3892
  * @description: 获取满足当前直播条件的流
@@ -4066,7 +4202,7 @@ declare class VePlayer {
4066
4202
  private vodLogCommon;
4067
4203
  /**
4068
4204
  * @hidden
4069
- * 延时触发的events,即保证在palyer创建之后才触发
4205
+ * 延时触发的events,即保证在player创建之后才触发
4070
4206
  */
4071
4207
  delayEvents: Array<{
4072
4208
  name: string;
@@ -4563,6 +4699,11 @@ declare class VePlayer {
4563
4699
  * @param pluginName 插件名。
4564
4700
  */
4565
4701
  getPlugin(pluginName: string): null | BasePlugin;
4702
+ /**
4703
+ * @brief 当前浏览器环境是否支持商业drm防录屏
4704
+ * @return boolean 是否支持商业drm防录屏
4705
+ */
4706
+ isDrmSupportUnRecord(): Promise<boolean>;
4566
4707
  /** {zh}
4567
4708
  * @memberof VePlayer
4568
4709
  * @brief 销毁当前播放器实例。
@@ -5427,6 +5568,34 @@ export declare const Events: {
5427
5568
  * @brief UMD 加载失败。
5428
5569
  */
5429
5570
  UMD_LOAD_FAIL: string;
5571
+ /** {zh}
5572
+ * @brief 切换下一个视频,playNext方法调用后触发
5573
+ */
5574
+ PLAYNEXT: string;
5575
+ /** {zh}
5576
+ * @brief 视频地址为空
5577
+ */
5578
+ URL_NULL: string;
5579
+ /** {zh}
5580
+ * @brief 鼠标移出
5581
+ */
5582
+ LEAVE_PLAYER: string;
5583
+ /** {zh}
5584
+ * @brief 鼠标移出
5585
+ */
5586
+ ENTER_PLAYER: string;
5587
+ /** {zh}
5588
+ * @brief 播放器状态重置
5589
+ */
5590
+ RESET: string;
5591
+ /** {zh}
5592
+ * @brief <source> 加载错误,表示<source>不支持或播放失败
5593
+ */
5594
+ SOURCE_ERROR: string;
5595
+ /** {zh}
5596
+ * @brief <source> 加载成功
5597
+ */
5598
+ SOURCE_SUCCESS: string;
5430
5599
  /** {zh}
5431
5600
  * @brief 在播放被终止时触发。例如当播放中的视频重新开始播放。
5432
5601
  */
@@ -5716,6 +5885,34 @@ export declare const Event: {
5716
5885
  * @brief UMD 加载失败。
5717
5886
  */
5718
5887
  UMD_LOAD_FAIL: string;
5888
+ /** {zh}
5889
+ * @brief 切换下一个视频,playNext方法调用后触发
5890
+ */
5891
+ PLAYNEXT: string;
5892
+ /** {zh}
5893
+ * @brief 视频地址为空
5894
+ */
5895
+ URL_NULL: string;
5896
+ /** {zh}
5897
+ * @brief 鼠标移出
5898
+ */
5899
+ LEAVE_PLAYER: string;
5900
+ /** {zh}
5901
+ * @brief 鼠标移出
5902
+ */
5903
+ ENTER_PLAYER: string;
5904
+ /** {zh}
5905
+ * @brief 播放器状态重置
5906
+ */
5907
+ RESET: string;
5908
+ /** {zh}
5909
+ * @brief <source> 加载错误,表示<source>不支持或播放失败
5910
+ */
5911
+ SOURCE_ERROR: string;
5912
+ /** {zh}
5913
+ * @brief <source> 加载成功
5914
+ */
5915
+ SOURCE_SUCCESS: string;
5719
5916
  };
5720
5917
  PluginEvents: {
5721
5918
  /** {zh}