@volcengine/veplayer 1.9.5-rc.1 → 1.9.5-rc.3
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 +91 -19
- package/index.min.js +2 -2
- package/package.json +1 -1
- package/plugin/XGVideo.js +2 -1
- package/plugin/danmujs.js +2 -1
- package/plugin/flv.js +1 -1
- package/plugin/hls.js +1 -1
- package/plugin/hlsEncrypt.js +2 -2
- package/plugin/vestrategy_adapt_range.js +1 -0
package/index.d.ts
CHANGED
|
@@ -3069,6 +3069,16 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
3069
3069
|
* @default -
|
|
3070
3070
|
*/
|
|
3071
3071
|
autoBitrateOpts?: IAutoBitrateOpts;
|
|
3072
|
+
/** {zh}
|
|
3073
|
+
* @brief Range拆分(动态Buffer)
|
|
3074
|
+
* @default -
|
|
3075
|
+
*/
|
|
3076
|
+
adaptRange?: IAdaptRange;
|
|
3077
|
+
/** {zh}
|
|
3078
|
+
* @brief 视频时长
|
|
3079
|
+
* @default -
|
|
3080
|
+
*/
|
|
3081
|
+
duration?: number;
|
|
3072
3082
|
/** {zh}
|
|
3073
3083
|
* @brief 外挂字幕配置。
|
|
3074
3084
|
* @default -
|
|
@@ -3598,12 +3608,16 @@ declare enum StrategyNames {
|
|
|
3598
3608
|
/**
|
|
3599
3609
|
* 预加载
|
|
3600
3610
|
*/
|
|
3601
|
-
PRELOAD = "preload"
|
|
3611
|
+
PRELOAD = "preload",
|
|
3612
|
+
/**
|
|
3613
|
+
* Range拆分-动态Buffer
|
|
3614
|
+
*/
|
|
3615
|
+
ADAPT_RANGE = "adaptRange"
|
|
3602
3616
|
}
|
|
3603
3617
|
/**{zh}
|
|
3604
3618
|
* @hidden
|
|
3605
3619
|
* h265策略配置
|
|
3606
|
-
* @detail
|
|
3620
|
+
* @detail Options
|
|
3607
3621
|
*/
|
|
3608
3622
|
export declare type IH265Config = {
|
|
3609
3623
|
/**
|
|
@@ -3617,7 +3631,7 @@ export declare type IH265Config = {
|
|
|
3617
3631
|
} & VeStrategyH265Config;
|
|
3618
3632
|
/**{zh}
|
|
3619
3633
|
* 预加载初始配置
|
|
3620
|
-
* @detail
|
|
3634
|
+
* @detail Options
|
|
3621
3635
|
*/
|
|
3622
3636
|
export declare type IPreloadConfig = {
|
|
3623
3637
|
/**
|
|
@@ -3655,12 +3669,25 @@ export declare type IPreloadConfig = {
|
|
|
3655
3669
|
disabled?: boolean;
|
|
3656
3670
|
};
|
|
3657
3671
|
/**{zh}
|
|
3658
|
-
*
|
|
3672
|
+
* Range拆分(动态Buffer)策略初始配置
|
|
3659
3673
|
* @detail detail
|
|
3660
3674
|
*/
|
|
3675
|
+
export declare type IAdaptRangeConfig = {
|
|
3676
|
+
/**
|
|
3677
|
+
* 预加载依赖Module
|
|
3678
|
+
*/
|
|
3679
|
+
Strategy?: any;
|
|
3680
|
+
/**
|
|
3681
|
+
* 是否禁用Range拆分策略
|
|
3682
|
+
*/
|
|
3683
|
+
disabled?: boolean;
|
|
3684
|
+
};
|
|
3685
|
+
/**{zh}
|
|
3686
|
+
* 高级能力(策略)配置
|
|
3687
|
+
* @detail Options
|
|
3688
|
+
*/
|
|
3661
3689
|
export declare type StrategyConfigOptions = {
|
|
3662
3690
|
/**
|
|
3663
|
-
* @hidden
|
|
3664
3691
|
* h265策略配置
|
|
3665
3692
|
*/
|
|
3666
3693
|
[StrategyNames.H265]?: boolean | IH265Config;
|
|
@@ -3668,10 +3695,14 @@ export declare type StrategyConfigOptions = {
|
|
|
3668
3695
|
* 预加载配置
|
|
3669
3696
|
*/
|
|
3670
3697
|
[StrategyNames.PRELOAD]?: boolean | IPreloadConfig;
|
|
3698
|
+
/**
|
|
3699
|
+
* Range拆分(动态Buffer)
|
|
3700
|
+
*/
|
|
3701
|
+
[StrategyNames.ADAPT_RANGE]?: boolean | IAdaptRangeConfig;
|
|
3671
3702
|
};
|
|
3672
3703
|
/**{zh}
|
|
3673
3704
|
* 播放器预初始化配置
|
|
3674
|
-
* @detail
|
|
3705
|
+
* @detail Options
|
|
3675
3706
|
*/
|
|
3676
3707
|
export declare type StrategyInitOptions = {
|
|
3677
3708
|
/**
|
|
@@ -3697,7 +3728,7 @@ export declare type StrategyInitOptions = {
|
|
|
3697
3728
|
};
|
|
3698
3729
|
/**{zh}
|
|
3699
3730
|
* 预加载实例,通过预加载实例可执行一些高级方法
|
|
3700
|
-
* @detail
|
|
3731
|
+
* @detail Options
|
|
3701
3732
|
*/
|
|
3702
3733
|
export declare type PreloaderManager = {
|
|
3703
3734
|
/**
|
|
@@ -3733,7 +3764,7 @@ declare enum PreloaderStatus {
|
|
|
3733
3764
|
}
|
|
3734
3765
|
/**{zh}
|
|
3735
3766
|
* 预加载配置更新
|
|
3736
|
-
* @detail
|
|
3767
|
+
* @detail Options
|
|
3737
3768
|
*/
|
|
3738
3769
|
export declare type IPreloadUpdateConfig = {
|
|
3739
3770
|
/**
|
|
@@ -3747,7 +3778,7 @@ export declare type IPreloadUpdateConfig = {
|
|
|
3747
3778
|
};
|
|
3748
3779
|
/**{zh}
|
|
3749
3780
|
* 预加载视频资源
|
|
3750
|
-
* @detail
|
|
3781
|
+
* @detail Options
|
|
3751
3782
|
*/
|
|
3752
3783
|
export declare type IPreloadStream = {
|
|
3753
3784
|
/**
|
|
@@ -3812,12 +3843,42 @@ declare class VeStrategyWrapper {
|
|
|
3812
3843
|
prepare(): Promise<boolean>;
|
|
3813
3844
|
getDeviceId(): string;
|
|
3814
3845
|
isReady(): boolean;
|
|
3815
|
-
getStrategyRecommendations(): StrategyRecommendation;
|
|
3816
|
-
getStrategyRecommendationsAsync(): Promise<StrategyRecommendation>;
|
|
3846
|
+
getStrategyRecommendations(options?: any, commonOptions?: any): StrategyRecommendation;
|
|
3847
|
+
getStrategyRecommendationsAsync(options?: any, commonOptions?: any): Promise<StrategyRecommendation>;
|
|
3817
3848
|
isHevcRecommended(): boolean;
|
|
3818
3849
|
private initPreloaderConfig;
|
|
3819
3850
|
}
|
|
3820
3851
|
declare const _default: VeStrategyWrapper;
|
|
3852
|
+
export interface IAdaptRangeDefaultOptions {
|
|
3853
|
+
maxTargetCacheDur: number;
|
|
3854
|
+
minTargetCacheDur: number;
|
|
3855
|
+
rangeMaxDuration: number;
|
|
3856
|
+
rangeMinDuration: number;
|
|
3857
|
+
cacheSafeFactor: number;
|
|
3858
|
+
estPTcontrol: boolean;
|
|
3859
|
+
estPlayTime: number;
|
|
3860
|
+
minBandwidth: number;
|
|
3861
|
+
minDangerThreshold: number;
|
|
3862
|
+
rangeControl: boolean;
|
|
3863
|
+
rangeMinSize: number;
|
|
3864
|
+
safeFactor: number;
|
|
3865
|
+
targetCacheControl: boolean;
|
|
3866
|
+
}
|
|
3867
|
+
declare abstract class AbstractBaseAdapter {
|
|
3868
|
+
isLive: boolean;
|
|
3869
|
+
playerData: any;
|
|
3870
|
+
streamType: string;
|
|
3871
|
+
constructor(options: any);
|
|
3872
|
+
abstract canOpenAbr(): boolean;
|
|
3873
|
+
abstract applyAbrPluginConfig(_finalOptions: any, _autoBitrateOpts: any): void;
|
|
3874
|
+
abstract prepareAbrModule(_playerData: any, _sdkUmdLoader: any): void;
|
|
3875
|
+
abstract needAbrAutoDefinition(): boolean;
|
|
3876
|
+
abstract setAbrDefaultDefiWithAuto(): boolean;
|
|
3877
|
+
abstract canAdaptRangeEnable(): boolean;
|
|
3878
|
+
abstract adaptRangeDefaultOptions(): IAdaptRangeDefaultOptions | undefined;
|
|
3879
|
+
abstract applyAdaptRangePluginConfig(_finalOptions: any, _adaptRangeOptions: any): void;
|
|
3880
|
+
abstract applyAdaptRangeStrategy(_finalOptions: any, _adaptRangeOptions: any): void;
|
|
3881
|
+
}
|
|
3821
3882
|
declare class PlayerData {
|
|
3822
3883
|
id?: string;
|
|
3823
3884
|
root?: HTMLElement;
|
|
@@ -3861,6 +3922,8 @@ declare class PlayerData {
|
|
|
3861
3922
|
urlExpireDiff: number;
|
|
3862
3923
|
urlCheckExpireInterval: number;
|
|
3863
3924
|
};
|
|
3925
|
+
private isAutoBitrateEnable;
|
|
3926
|
+
adapter: AbstractBaseAdapter;
|
|
3864
3927
|
isBusinessDrm: boolean;
|
|
3865
3928
|
isEncrypt: boolean;
|
|
3866
3929
|
dashOpts: {
|
|
@@ -3873,6 +3936,12 @@ declare class PlayerData {
|
|
|
3873
3936
|
*/
|
|
3874
3937
|
initPlayData(configs: IPlayerConfig): void;
|
|
3875
3938
|
initPlaylistAndGetCurrent(configs: IPlayerConfig): Stream;
|
|
3939
|
+
checkAutoBitratePlayList(): boolean;
|
|
3940
|
+
getABRStreamInfo(streamType: any, originDefaultStream: any): {
|
|
3941
|
+
defaultDefinition: string;
|
|
3942
|
+
defaultStream: any;
|
|
3943
|
+
playList: Stream[];
|
|
3944
|
+
};
|
|
3876
3945
|
isCurrentH265(): boolean;
|
|
3877
3946
|
getCurrentByDefaultConfig(): Stream;
|
|
3878
3947
|
initCurrent(currentStreams: Stream): void;
|
|
@@ -3889,12 +3958,13 @@ declare class PlayerData {
|
|
|
3889
3958
|
* @description: 获取当前直播url
|
|
3890
3959
|
*/
|
|
3891
3960
|
getCurrentUrl(): Url;
|
|
3961
|
+
getTargetStreamType(stream?: Stream): string;
|
|
3892
3962
|
/**
|
|
3893
3963
|
* @description: 获取当前的streamType
|
|
3894
3964
|
*/
|
|
3895
3965
|
getCurrentStreamType(): string;
|
|
3896
3966
|
getStreamType(): string;
|
|
3897
|
-
isOpenABR(
|
|
3967
|
+
isOpenABR(): boolean;
|
|
3898
3968
|
showRealDefinition(): boolean;
|
|
3899
3969
|
isAutoDefinition(def: any): boolean;
|
|
3900
3970
|
isPlayAutoDefinition(def?: string): boolean;
|
|
@@ -3998,6 +4068,7 @@ declare enum UmdKeys {
|
|
|
3998
4068
|
VeStrategy = "vestrategy",
|
|
3999
4069
|
VeStrategyH265 = "vestrategy_h265",
|
|
4000
4070
|
VeStrategyPreload = "vestrategy_preload",
|
|
4071
|
+
VeStrategyAdaptRange = "vestrategy_adapt_range",
|
|
4001
4072
|
DashAbralgo = "DashAbralgo",
|
|
4002
4073
|
Preloader = "preloader"
|
|
4003
4074
|
}
|
|
@@ -4165,6 +4236,7 @@ declare class VePlayer {
|
|
|
4165
4236
|
* @memberof VePlayer
|
|
4166
4237
|
*/
|
|
4167
4238
|
sdkUmdLoader: umdLoader;
|
|
4239
|
+
private adapter;
|
|
4168
4240
|
/**
|
|
4169
4241
|
* @hidden
|
|
4170
4242
|
*/
|
|
@@ -4183,33 +4255,33 @@ declare class VePlayer {
|
|
|
4183
4255
|
* @memberof VePlayer
|
|
4184
4256
|
*/
|
|
4185
4257
|
static sdkVersion: string;
|
|
4186
|
-
/**{zh}
|
|
4187
|
-
* @brief
|
|
4258
|
+
/** {zh}
|
|
4259
|
+
* @brief 播放策略预初始化配置
|
|
4188
4260
|
* @param options 初始化配置,详情见{@link StrategyInitOptions}
|
|
4189
4261
|
*/
|
|
4190
4262
|
static prepare(options: StrategyInitOptions): Promise<void>;
|
|
4191
|
-
/**{zh}
|
|
4263
|
+
/** {zh}
|
|
4192
4264
|
* @brief 设置预加载模式
|
|
4193
4265
|
* @param preloadScene 预加载模式,详情见{@link PreloadScene}
|
|
4194
4266
|
* @param options 预加载配置更新,详情见{@link IPreloadUpdateConfig}
|
|
4195
4267
|
*/
|
|
4196
4268
|
static setPreloadScene(preloadScene: PreloadScene, options?: IPreloadUpdateConfig): void;
|
|
4197
|
-
/**{zh}
|
|
4269
|
+
/** {zh}
|
|
4198
4270
|
* @brief 获取预加载实例,可通过预加载实例执行高级方法,需在VePlayer.prepare Promise执行完成之后才能获取到预加载实例
|
|
4199
4271
|
* @returns 预加载实例,详情见{@link PreloaderManager}
|
|
4200
4272
|
*/
|
|
4201
4273
|
static get preloader(): PreloaderManager | undefined;
|
|
4202
|
-
/**{zh}
|
|
4274
|
+
/** {zh}
|
|
4203
4275
|
* @brief 获取当前预加载实例状态
|
|
4204
4276
|
* @returns 预加载实例状态,详情见{@link PreloaderStatus}
|
|
4205
4277
|
*/
|
|
4206
4278
|
static get preloaderStatus(): PreloaderStatus;
|
|
4207
|
-
/**{zh}
|
|
4279
|
+
/** {zh}
|
|
4208
4280
|
* @brief 添加待预加载视频列表
|
|
4209
4281
|
* @param list 待预加载视频列表,详情见{@link IPreloadStream[]}。
|
|
4210
4282
|
*/
|
|
4211
4283
|
static addPreloadList(list: IPreloadStream[]): void;
|
|
4212
|
-
/**{zh}
|
|
4284
|
+
/** {zh}
|
|
4213
4285
|
* @brief 设置待预加载视频列表,替换当前已设置的待预加载列表
|
|
4214
4286
|
* @param list 待预加载视频列表,详情见{@link IPreloadStream[]}
|
|
4215
4287
|
*/
|