@volcengine/veplayer 1.10.0-rc.9 → 1.12.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
@@ -1253,6 +1253,75 @@ export declare type IDefinition = {
1253
1253
  [propName: string]: any;
1254
1254
  };
1255
1255
  };
1256
+ /**
1257
+ * @brief 音量配置。
1258
+ * @list Options
1259
+ * @kind property
1260
+ */
1261
+ export declare type IVolume = number | {
1262
+ /**
1263
+ * @brief 插件Dom挂载的位置,默认播放器底部控制栏右侧
1264
+ * @default POSITIONS.CONTROLS_RIGHT
1265
+ */
1266
+ position?: POSITIONS;
1267
+ /**
1268
+ * @brief 插件在挂载的位置的排序权重
1269
+ * @default 1
1270
+ */
1271
+ index?: number;
1272
+ /**
1273
+ * @brief 是否禁用插件交互行为,即是否隐藏音量调节按钮
1274
+ * @default false
1275
+ */
1276
+ disable?: boolean;
1277
+ /**
1278
+ * @brief 是否在音量调节slider上方显示当前音量数值
1279
+ * @default false
1280
+ */
1281
+ showValueLabel?: boolean;
1282
+ /**
1283
+ * @brief 默认音量大小,取值范围0-1
1284
+ * @default 0.6
1285
+ */
1286
+ default?: number;
1287
+ /**
1288
+ * @brief 静音恢复的时候最小音量
1289
+ * @default 0.2
1290
+ */
1291
+ miniVolume?: number;
1292
+ };
1293
+ /**
1294
+ * @brief 进度条标记点配置。
1295
+ * @list Options
1296
+ * @kind property
1297
+ */
1298
+ export interface IDot {
1299
+ /**
1300
+ * @brief 进度条标记点
1301
+ * @default 1
1302
+ */
1303
+ id: string | number;
1304
+ /**
1305
+ * @brief 标记点所在的播放时间
1306
+ * @default 0
1307
+ */
1308
+ time: number;
1309
+ /**
1310
+ * @brief 进度条自定义文案
1311
+ * @default -
1312
+ */
1313
+ text?: string;
1314
+ /**
1315
+ * @brief 标记点持续的时间,单位秒
1316
+ * @default 1
1317
+ */
1318
+ duration?: number;
1319
+ /**
1320
+ * @brief 进度条自定义的CSS Style样式
1321
+ * @default -
1322
+ */
1323
+ style?: CSSStyleDeclaration;
1324
+ }
1256
1325
  /**
1257
1326
  * @hidden
1258
1327
  */
@@ -1371,10 +1440,6 @@ export declare type IPlayerOptions = {
1371
1440
  };
1372
1441
  /**
1373
1442
  * @brief mobile端交互配置。
1374
- * @hidden
1375
- */
1376
- /** {en}
1377
- * @hidden
1378
1443
  */
1379
1444
  export interface IMobileConfig {
1380
1445
  /**
@@ -1391,7 +1456,7 @@ export interface IMobileConfig {
1391
1456
  */
1392
1457
  gestureX?: boolean;
1393
1458
  /**
1394
- * @brief 是否启用垂直手势处理, 垂直手势包括屏幕右侧和屏幕左侧,默认左侧调节亮度,右侧调节音量,左右范围比例通过scopeL和scopeR设置
1459
+ * @brief 是否启用垂直手势处理,默认不启用, 垂直手势包括屏幕右侧和屏幕左侧,默认左侧调节亮度,右侧调节音量,左右范围比例通过scopeL和scopeR设置
1395
1460
  * @default false
1396
1461
  */
1397
1462
  gestureY?: boolean;
@@ -1483,10 +1548,6 @@ export interface IMobileConfig {
1483
1548
  }
1484
1549
  /**
1485
1550
  * @brief 播放器中间切换暂停/播放的按钮。
1486
- * @hidden
1487
- */
1488
- /** {en}
1489
- * @hidden
1490
1551
  */
1491
1552
  export interface IStartConfig {
1492
1553
  /**
@@ -2811,12 +2872,12 @@ export interface IPlayerConfig extends IPlayerOptions {
2811
2872
  */
2812
2873
  fitVideoSize?: "fixWidth" | "fixHeight" | "fixed";
2813
2874
  /** {zh}
2814
- * @brief 视频画面填充模式。取值如下:
2815
- * - `fillwidth`: 填充宽度,高度溢出则裁剪高度。
2816
- * - `fillHeight`: 填充高度,宽度溢出则裁剪宽度。
2817
- * - `fill`: 拉伸视频以填充容器。
2818
- * - `cover`: 保持视频宽高比的同时填充元素的整个内容框。
2819
- * - `auto`: 使用浏览器默认的视频画面填充模式。
2875
+ * @brief 视频画面填充模式,等同于设置{@link https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit CSS object-fit}属性。取值如下:
2876
+ * - `auto`: 使用浏览器默认的视频画面填充模式,注意设置此值时,在视频的宽高与播放器容器的宽高不匹配时会出现黑边。
2877
+ * - `fill`: 拉伸视频以填充播放器容器,等同于设置 CSS `object-fit: fill`,注意设置此值时,视频画面会被被拉伸变形。
2878
+ * - `cover`: 保持视频宽高比的同时填充整个播放器容器,等同于设置 CSS `object-fit: cover`,注意设置此值时,视频画面会被被部分裁剪。
2879
+ * - `fillWidth`: 填充宽度,高度溢出则裁剪高度,当播放器容器宽高比小于视频的宽高比,等同于设置CSS `object-fit: cover`。
2880
+ * - `fillHeight`: 填充高度,宽度溢出则裁剪宽度,当播放器容器宽高比大于视频的宽高比,等同于设置CSS `object-fit: cover`。
2820
2881
  * @default auto
2821
2882
  */
2822
2883
  videoFillMode?: "auto" | "fillHeight" | "fillWidth" | "fill" | "cover";
@@ -3226,6 +3287,11 @@ export interface IPlayerConfig extends IPlayerOptions {
3226
3287
  * @default -
3227
3288
  */
3228
3289
  thumbnail?: IThumbnailConfig;
3290
+ /** {zh}
3291
+ * @brief 进度条标记配置
3292
+ * @default -
3293
+ */
3294
+ progressDot?: IDot[];
3229
3295
  }
3230
3296
  /**
3231
3297
  * @brief 播放源数据。支持传入视频播放地址 `url`、播放列表 `playList` 或者 `vid` 和 `playAuthToken`,还需包含新地址的过期时间戳 `urlExpireTimestamp`。
@@ -3274,12 +3340,11 @@ export interface IDefaultConfig {
3274
3340
  */
3275
3341
  startTime?: number;
3276
3342
  /** {zh}
3277
- * @brief 音量
3278
- *
3279
- * @type {number}
3280
- * @memberof IDefaultConfig
3343
+ * @brief 音量配置,如果为数字则表示默认音量大小,取值0-1,
3344
+ * 如果是对象则可以对音量控制插件进行各型特性单独配置
3345
+ * @default 0.6
3281
3346
  */
3282
- volume?: number;
3347
+ volume?: IVolume;
3283
3348
  /** {zh}
3284
3349
  * @brief 弹幕插件配置
3285
3350
  *
@@ -3463,6 +3528,48 @@ export interface definitionItem {
3463
3528
  */
3464
3529
  definitionTextKey?: string;
3465
3530
  }
3531
+ /** {zh}
3532
+ * @brief 插件按钮位置
3533
+ */
3534
+ export declare const enum POSITIONS {
3535
+ /** {zh}
3536
+ * @brief 播放器根节点
3537
+ */
3538
+ ROOT = "root",
3539
+ /** {zh}
3540
+ * @brief 播放器根节点左侧
3541
+ */
3542
+ ROOT_LEFT = "rootLeft",
3543
+ /** {zh}
3544
+ * @brief 播放器根节点右侧
3545
+ */
3546
+ ROOT_RIGHT = "rootRight",
3547
+ /** {zh}
3548
+ * @brief 播放器根节点顶部
3549
+ */
3550
+ ROOT_TOP = "rootTop",
3551
+ /** {zh}
3552
+ * @brief 播控栏左侧
3553
+ */
3554
+ CONTROLS_LEFT = "controlsLeft",
3555
+ /** {zh}
3556
+ * @brief 播控栏左侧
3557
+ */
3558
+ CONTROLS_RIGTH = "controlsRight",
3559
+ /** {zh}
3560
+ * @brief 播控栏右侧
3561
+ */
3562
+ CONTROLS_RIGHT = "controlsRight",
3563
+ /** {zh}
3564
+ * @brief 播控栏中间
3565
+ */
3566
+ CONTROLS_CENTER = "controlsCenter",
3567
+ /** {zh}
3568
+ * @hidden
3569
+ * @brief 播控栏左侧
3570
+ */
3571
+ CONTROLS = "controls"
3572
+ }
3466
3573
  /**
3467
3574
  * @brief Plugin类插件基础配置
3468
3575
  */
@@ -4071,6 +4178,10 @@ declare abstract class AbstractBaseAdapter {
4071
4178
  playerData: PlayerData;
4072
4179
  streamType: string;
4073
4180
  });
4181
+ /**
4182
+ * @description 是否使用原生video的abr能力
4183
+ */
4184
+ abstract useNativeAbr(): boolean;
4074
4185
  abstract canOpenAbr(vidPlayInfo?: VideoInfoRes): boolean;
4075
4186
  abstract applyAbrPluginConfig(_finalOptions: any, _autoBitrateOpts: any): void;
4076
4187
  abstract prepareAbrModule(_playerData: any, _sdkUmdLoader: any): void;
@@ -4133,7 +4244,9 @@ declare class PlayerData {
4133
4244
  Data: IGetPlayInfoRes;
4134
4245
  };
4135
4246
  sdk: VePlayer;
4136
- constructor(configs: IPlayerConfig, sdk: VePlayer);
4247
+ constructor(configs: IPlayerConfig & {
4248
+ licensSupportModuleList: string[];
4249
+ }, sdk: VePlayer);
4137
4250
  /**
4138
4251
  * 初始化播放数据
4139
4252
  * @param configs { IPlayerConfig } 播放器配置
@@ -4333,6 +4446,34 @@ declare class umdLoader {
4333
4446
  */
4334
4447
  loadPlugins(pluginName: UmdKeys, successCallback?: () => void): Promise<any>;
4335
4448
  }
4449
+ export interface IlicenseContent {
4450
+ content: string;
4451
+ sign: string;
4452
+ mainUrl?: string;
4453
+ }
4454
+ declare enum LicenseEdition {
4455
+ EDITION_STANDARD = "standard_edition",
4456
+ EDITION_PREMIUM = "premium_edition",
4457
+ EDITION_NONE = "none_edition"
4458
+ }
4459
+ declare enum LicenseFeature {
4460
+ H265 = "h265",
4461
+ PRELOAD = "preload",
4462
+ ADAPT_RANGE = "adaptRange",
4463
+ ABR = "abr"
4464
+ }
4465
+ declare enum LicenseStatus {
4466
+ LICENSE_STATUS_INVALID = 0,
4467
+ LICENSE_STATUS_OK = 1,
4468
+ LICENSE_STATUS_EXPIRED = 2,
4469
+ LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH = 401
4470
+ }
4471
+ export interface ILicenseConfig {
4472
+ license: string | IlicenseContent;
4473
+ autoUpload?: boolean;
4474
+ expireDiffTime?: number;
4475
+ expireCallback?: (expireDiffTime?: number) => void;
4476
+ }
4336
4477
  /** {zh}
4337
4478
  * @hidden
4338
4479
  */
@@ -4341,13 +4482,17 @@ declare class umdLoader {
4341
4482
  */
4342
4483
  export declare type PlayerCore = Player & {
4343
4484
  sdk?: VePlayer;
4344
- changePluginsIcon?: (name: any, isShow: any) => void;
4485
+ changePluginsIcon?: (name: string, isShow: boolean) => void;
4345
4486
  playerData?: PlayerData;
4346
4487
  playerType?: string;
4347
4488
  playerVersion?: string;
4348
4489
  panel?: MobilePlayerPanel;
4349
4490
  emitExpireTimestamp?: number;
4350
4491
  vodLogger?: VodLogger;
4492
+ licenseLogInfo?: {
4493
+ licenseStatus: LicenseStatus;
4494
+ licenseType: LicenseEdition;
4495
+ };
4351
4496
  };
4352
4497
  declare class VePlayer {
4353
4498
  /** {zh}
@@ -4516,7 +4661,19 @@ declare class VePlayer {
4516
4661
  static isRTMSupportCodec: (codec: RTMCodec, options: {
4517
4662
  targetProfileLevel?: string;
4518
4663
  }) => Promise<boolean>;
4519
- private vodLogCommon;
4664
+ static setLicenseConfig(config: ILicenseConfig): Promise<void>;
4665
+ static checkLicense(): Promise<LicenseEdition>;
4666
+ static checkModuleList(): Promise<string[]>;
4667
+ static checkLicenseStatus(): Promise<LicenseStatus>;
4668
+ static checkLicenseModuleAuth(module: string, featureName: LicenseFeature): Promise<boolean>;
4669
+ private static vodLogCommon;
4670
+ private static hasInitVeStrategy;
4671
+ /**
4672
+ * @hidden
4673
+ * 延时触发的events,即保证在player创建之后才触发
4674
+ */
4675
+ private _isVolcengine;
4676
+ private _originConfigs;
4520
4677
  /**
4521
4678
  * @hidden
4522
4679
  * 延时触发的events,即保证在player创建之后才触发
@@ -4641,7 +4798,8 @@ declare class VePlayer {
4641
4798
  /** {en}
4642
4799
  * @hidden
4643
4800
  */
4644
- createPlayer(): Promise<PlayerCore>;
4801
+ createPlayer: () => Promise<PlayerCore>;
4802
+ private checkLicenseCallback;
4645
4803
  /** {zh}
4646
4804
  * @hidden
4647
4805
  * @brief 设置合并开发者的插件配置,如果开发者从初始化的configs里传了插件配置,则只用开发者的配置,并补齐其他参数
@@ -4689,7 +4847,7 @@ declare class VePlayer {
4689
4847
  lineId?: string | number;
4690
4848
  definition?: string;
4691
4849
  startTime?: number;
4692
- volume?: number;
4850
+ volume?: IVolume;
4693
4851
  DanmuPlugin?: any;
4694
4852
  LiveSubtitlesIconPlugin?: any;
4695
4853
  };
@@ -4733,6 +4891,11 @@ declare class VePlayer {
4733
4891
  * @memberof VePlayer
4734
4892
  */
4735
4893
  private _setPlayerInfo;
4894
+ /**
4895
+ * @hidden
4896
+ * @private
4897
+ */
4898
+ private getVtype;
4736
4899
  /**
4737
4900
  *
4738
4901
  *
@@ -4748,6 +4911,7 @@ declare class VePlayer {
4748
4911
  * @memberof VePlayer
4749
4912
  */
4750
4913
  private _bindPlayerEvents;
4914
+ private _proxyError;
4751
4915
  private _onError;
4752
4916
  /** {zh}
4753
4917
  * @private
@@ -4838,6 +5002,7 @@ declare class VePlayer {
4838
5002
  */
4839
5003
  set src(url: Url);
4840
5004
  /** {zh}
5005
+ * @hidden
4841
5006
  * @brief 播放时更换视频 URL,以更换视频源。
4842
5007
  * @notes 更换后,会从更换前的时间点继续播放。
4843
5008
  * @param url 视频播放地址。
@@ -5773,17 +5938,17 @@ export declare const Events: {
5773
5938
  */
5774
5939
  URL_CHANGE: string;
5775
5940
  /** {zh}
5776
- * @brief 播放器聚焦。
5941
+ * @brief 播放器聚焦,同时会展示 Control 栏控件,包含播放按钮、进度条等。
5777
5942
  */
5778
5943
  /** {en}
5779
- * @brief The player has focus.
5944
+ * @brief The player is active and the control bar will appear showing options like play button, progress bar, and other controls.
5780
5945
  */
5781
5946
  PLAYER_FOCUS: string;
5782
5947
  /** {zh}
5783
- * @brief 播放器失焦。
5948
+ * @brief 播放器失焦,同时会隐藏 Control 栏控件,包含播放按钮、进度条等。
5784
5949
  */
5785
5950
  /** {en}
5786
- * @brief The player loses focus.
5951
+ * @brief The player is inactive and the control bar will vanish, hiding options such as the play button, progress bar, and other controls.
5787
5952
  */
5788
5953
  PLAYER_BLUR: string;
5789
5954
  /** {zh}
@@ -5873,7 +6038,7 @@ export declare const Events: {
5873
6038
  SHORTCUT: string;
5874
6039
  /** {zh}
5875
6040
  * @deprecated
5876
- * @brief SEI 信息解析。
6041
+ * @brief (已废弃)SEI 信息解析。
5877
6042
  */
5878
6043
  /** {en}
5879
6044
  * @deprecated
@@ -5953,6 +6118,10 @@ export declare const Events: {
5953
6118
  * @brief `<source>` 加载成功。
5954
6119
  */
5955
6120
  SOURCE_SUCCESS: string;
6121
+ /** {zh}
6122
+ * @brief license 提醒
6123
+ */
6124
+ LICENSE_STATUS_WARNING: string;
5956
6125
  /** {zh}
5957
6126
  * @brief 在播放被终止时触发。例如当播放中的视频重新开始播放。
5958
6127
  */
@@ -6092,17 +6261,17 @@ export declare const Event: {
6092
6261
  */
6093
6262
  URL_CHANGE: string;
6094
6263
  /** {zh}
6095
- * @brief 播放器聚焦。
6264
+ * @brief 播放器聚焦,同时会展示 Control 栏控件,包含播放按钮、进度条等。
6096
6265
  */
6097
6266
  /** {en}
6098
- * @brief The player has focus.
6267
+ * @brief The player is active and the control bar will appear showing options like play button, progress bar, and other controls.
6099
6268
  */
6100
6269
  PLAYER_FOCUS: string;
6101
6270
  /** {zh}
6102
- * @brief 播放器失焦。
6271
+ * @brief 播放器失焦,同时会隐藏 Control 栏控件,包含播放按钮、进度条等。
6103
6272
  */
6104
6273
  /** {en}
6105
- * @brief The player loses focus.
6274
+ * @brief The player is inactive and the control bar will vanish, hiding options such as the play button, progress bar, and other controls.
6106
6275
  */
6107
6276
  PLAYER_BLUR: string;
6108
6277
  /** {zh}
@@ -6192,7 +6361,7 @@ export declare const Event: {
6192
6361
  SHORTCUT: string;
6193
6362
  /** {zh}
6194
6363
  * @deprecated
6195
- * @brief SEI 信息解析。
6364
+ * @brief (已废弃)SEI 信息解析。
6196
6365
  */
6197
6366
  /** {en}
6198
6367
  * @deprecated
@@ -6272,6 +6441,10 @@ export declare const Event: {
6272
6441
  * @brief `<source>` 加载成功。
6273
6442
  */
6274
6443
  SOURCE_SUCCESS: string;
6444
+ /** {zh}
6445
+ * @brief license 提醒
6446
+ */
6447
+ LICENSE_STATUS_WARNING: string;
6275
6448
  };
6276
6449
  PluginEvents: {
6277
6450
  /** {zh}