@volcengine/veplayer 1.9.2 → 1.9.3-rc.1

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