@volcengine/veplayer 1.10.0-rc.8 → 1.10.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 +151 -33
- package/index.min.css +1 -1
- package/index.min.js +2 -2
- package/package.json +1 -1
- package/plugin/hls.js +1 -1
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
|
|
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
|
-
* - `
|
|
2816
|
-
* - `
|
|
2817
|
-
* - `
|
|
2818
|
-
* - `
|
|
2819
|
-
* - `
|
|
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
|
-
* @
|
|
3280
|
-
* @memberof IDefaultConfig
|
|
3343
|
+
* @brief 音量配置,如果为数字则表示默认音量大小,取值0-1,
|
|
3344
|
+
* 如果是对象则可以对音量控制插件进行各型特性单独配置
|
|
3345
|
+
* @default 0.6
|
|
3281
3346
|
*/
|
|
3282
|
-
volume?:
|
|
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;
|
|
@@ -4341,7 +4452,7 @@ declare class umdLoader {
|
|
|
4341
4452
|
*/
|
|
4342
4453
|
export declare type PlayerCore = Player & {
|
|
4343
4454
|
sdk?: VePlayer;
|
|
4344
|
-
changePluginsIcon?: (name:
|
|
4455
|
+
changePluginsIcon?: (name: string, isShow: boolean) => void;
|
|
4345
4456
|
playerData?: PlayerData;
|
|
4346
4457
|
playerType?: string;
|
|
4347
4458
|
playerVersion?: string;
|
|
@@ -4641,7 +4752,7 @@ declare class VePlayer {
|
|
|
4641
4752
|
/** {en}
|
|
4642
4753
|
* @hidden
|
|
4643
4754
|
*/
|
|
4644
|
-
createPlayer()
|
|
4755
|
+
createPlayer: () => Promise<PlayerCore>;
|
|
4645
4756
|
/** {zh}
|
|
4646
4757
|
* @hidden
|
|
4647
4758
|
* @brief 设置合并开发者的插件配置,如果开发者从初始化的configs里传了插件配置,则只用开发者的配置,并补齐其他参数
|
|
@@ -4689,7 +4800,7 @@ declare class VePlayer {
|
|
|
4689
4800
|
lineId?: string | number;
|
|
4690
4801
|
definition?: string;
|
|
4691
4802
|
startTime?: number;
|
|
4692
|
-
volume?:
|
|
4803
|
+
volume?: IVolume;
|
|
4693
4804
|
DanmuPlugin?: any;
|
|
4694
4805
|
LiveSubtitlesIconPlugin?: any;
|
|
4695
4806
|
};
|
|
@@ -4733,6 +4844,11 @@ declare class VePlayer {
|
|
|
4733
4844
|
* @memberof VePlayer
|
|
4734
4845
|
*/
|
|
4735
4846
|
private _setPlayerInfo;
|
|
4847
|
+
/**
|
|
4848
|
+
* @hidden
|
|
4849
|
+
* @private
|
|
4850
|
+
*/
|
|
4851
|
+
private getVtype;
|
|
4736
4852
|
/**
|
|
4737
4853
|
*
|
|
4738
4854
|
*
|
|
@@ -4748,6 +4864,7 @@ declare class VePlayer {
|
|
|
4748
4864
|
* @memberof VePlayer
|
|
4749
4865
|
*/
|
|
4750
4866
|
private _bindPlayerEvents;
|
|
4867
|
+
private _proxyError;
|
|
4751
4868
|
private _onError;
|
|
4752
4869
|
/** {zh}
|
|
4753
4870
|
* @private
|
|
@@ -4838,6 +4955,7 @@ declare class VePlayer {
|
|
|
4838
4955
|
*/
|
|
4839
4956
|
set src(url: Url);
|
|
4840
4957
|
/** {zh}
|
|
4958
|
+
* @hidden
|
|
4841
4959
|
* @brief 播放时更换视频 URL,以更换视频源。
|
|
4842
4960
|
* @notes 更换后,会从更换前的时间点继续播放。
|
|
4843
4961
|
* @param url 视频播放地址。
|
|
@@ -5773,17 +5891,17 @@ export declare const Events: {
|
|
|
5773
5891
|
*/
|
|
5774
5892
|
URL_CHANGE: string;
|
|
5775
5893
|
/** {zh}
|
|
5776
|
-
* @brief
|
|
5894
|
+
* @brief 播放器聚焦,同时会展示 Control 栏控件,包含播放按钮、进度条等。
|
|
5777
5895
|
*/
|
|
5778
5896
|
/** {en}
|
|
5779
|
-
* @brief The player
|
|
5897
|
+
* @brief The player is active and the control bar will appear showing options like play button, progress bar, and other controls.
|
|
5780
5898
|
*/
|
|
5781
5899
|
PLAYER_FOCUS: string;
|
|
5782
5900
|
/** {zh}
|
|
5783
|
-
* @brief
|
|
5901
|
+
* @brief 播放器失焦,同时会隐藏 Control 栏控件,包含播放按钮、进度条等。
|
|
5784
5902
|
*/
|
|
5785
5903
|
/** {en}
|
|
5786
|
-
* @brief The player
|
|
5904
|
+
* @brief The player is inactive and the control bar will vanish, hiding options such as the play button, progress bar, and other controls.
|
|
5787
5905
|
*/
|
|
5788
5906
|
PLAYER_BLUR: string;
|
|
5789
5907
|
/** {zh}
|
|
@@ -5873,7 +5991,7 @@ export declare const Events: {
|
|
|
5873
5991
|
SHORTCUT: string;
|
|
5874
5992
|
/** {zh}
|
|
5875
5993
|
* @deprecated
|
|
5876
|
-
* @brief SEI 信息解析。
|
|
5994
|
+
* @brief (已废弃)SEI 信息解析。
|
|
5877
5995
|
*/
|
|
5878
5996
|
/** {en}
|
|
5879
5997
|
* @deprecated
|
|
@@ -6092,17 +6210,17 @@ export declare const Event: {
|
|
|
6092
6210
|
*/
|
|
6093
6211
|
URL_CHANGE: string;
|
|
6094
6212
|
/** {zh}
|
|
6095
|
-
* @brief
|
|
6213
|
+
* @brief 播放器聚焦,同时会展示 Control 栏控件,包含播放按钮、进度条等。
|
|
6096
6214
|
*/
|
|
6097
6215
|
/** {en}
|
|
6098
|
-
* @brief The player
|
|
6216
|
+
* @brief The player is active and the control bar will appear showing options like play button, progress bar, and other controls.
|
|
6099
6217
|
*/
|
|
6100
6218
|
PLAYER_FOCUS: string;
|
|
6101
6219
|
/** {zh}
|
|
6102
|
-
* @brief
|
|
6220
|
+
* @brief 播放器失焦,同时会隐藏 Control 栏控件,包含播放按钮、进度条等。
|
|
6103
6221
|
*/
|
|
6104
6222
|
/** {en}
|
|
6105
|
-
* @brief The player
|
|
6223
|
+
* @brief The player is inactive and the control bar will vanish, hiding options such as the play button, progress bar, and other controls.
|
|
6106
6224
|
*/
|
|
6107
6225
|
PLAYER_BLUR: string;
|
|
6108
6226
|
/** {zh}
|
|
@@ -6192,7 +6310,7 @@ export declare const Event: {
|
|
|
6192
6310
|
SHORTCUT: string;
|
|
6193
6311
|
/** {zh}
|
|
6194
6312
|
* @deprecated
|
|
6195
|
-
* @brief SEI 信息解析。
|
|
6313
|
+
* @brief (已废弃)SEI 信息解析。
|
|
6196
6314
|
*/
|
|
6197
6315
|
/** {en}
|
|
6198
6316
|
* @deprecated
|