@volcengine/veplayer 1.9.6-rc.0 → 1.9.6-rc.2
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 +143 -26
- package/index.min.css +1 -1
- package/index.min.js +2 -2
- package/package.json +1 -1
- package/plugin/danmujs.js +2 -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
|
@@ -2101,7 +2101,7 @@ export interface ISubtitleInfoList {
|
|
|
2101
2101
|
Version: string;
|
|
2102
2102
|
Vid: string;
|
|
2103
2103
|
}
|
|
2104
|
-
export interface
|
|
2104
|
+
export interface IThumbInfoItem {
|
|
2105
2105
|
CaptureNum: number;
|
|
2106
2106
|
CellHeight: number;
|
|
2107
2107
|
CellWidth: number;
|
|
@@ -2121,9 +2121,20 @@ export interface IBarrageMaskInfo {
|
|
|
2121
2121
|
Bitrate: number;
|
|
2122
2122
|
HeadLen: number;
|
|
2123
2123
|
}
|
|
2124
|
+
export interface DashAdaptiveInfo {
|
|
2125
|
+
AdaptiveType: string;
|
|
2126
|
+
BackupPlayUrl: string;
|
|
2127
|
+
MainPlayUrl: string;
|
|
2128
|
+
}
|
|
2129
|
+
export interface ABRInfo {
|
|
2130
|
+
AbrFormat: string;
|
|
2131
|
+
BackupPlayUrl: string;
|
|
2132
|
+
MainPlayUrl: string;
|
|
2133
|
+
}
|
|
2124
2134
|
export interface IGetPlayInfoRes {
|
|
2125
2135
|
Vid: string;
|
|
2126
|
-
AdaptiveInfo?:
|
|
2136
|
+
AdaptiveInfo?: DashAdaptiveInfo;
|
|
2137
|
+
AdaptiveBitrateStreamingInfo?: ABRInfo;
|
|
2127
2138
|
BarrageMaskInfo?: IBarrageMaskInfo;
|
|
2128
2139
|
BarrageMaskUrl: string;
|
|
2129
2140
|
Duration: number;
|
|
@@ -2133,7 +2144,7 @@ export interface IGetPlayInfoRes {
|
|
|
2133
2144
|
PosterUrl: string;
|
|
2134
2145
|
Status: number;
|
|
2135
2146
|
SubtitleInfoList: ISubtitleInfoList[];
|
|
2136
|
-
ThumbInfoList:
|
|
2147
|
+
ThumbInfoList: IThumbInfoItem[];
|
|
2137
2148
|
TotalCount: number;
|
|
2138
2149
|
Version: number;
|
|
2139
2150
|
}
|
|
@@ -3069,6 +3080,16 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
3069
3080
|
* @default -
|
|
3070
3081
|
*/
|
|
3071
3082
|
autoBitrateOpts?: IAutoBitrateOpts;
|
|
3083
|
+
/** {zh}
|
|
3084
|
+
* @brief Range拆分(动态Buffer)
|
|
3085
|
+
* @default -
|
|
3086
|
+
*/
|
|
3087
|
+
adaptRange?: IAdaptRange;
|
|
3088
|
+
/** {zh}
|
|
3089
|
+
* @brief 视频时长
|
|
3090
|
+
* @default -
|
|
3091
|
+
*/
|
|
3092
|
+
duration?: number;
|
|
3072
3093
|
/** {zh}
|
|
3073
3094
|
* @brief 外挂字幕配置。
|
|
3074
3095
|
* @default -
|
|
@@ -3598,12 +3619,16 @@ declare enum StrategyNames {
|
|
|
3598
3619
|
/**
|
|
3599
3620
|
* 预加载
|
|
3600
3621
|
*/
|
|
3601
|
-
PRELOAD = "preload"
|
|
3622
|
+
PRELOAD = "preload",
|
|
3623
|
+
/**
|
|
3624
|
+
* Range拆分-动态Buffer
|
|
3625
|
+
*/
|
|
3626
|
+
ADAPT_RANGE = "adaptRange"
|
|
3602
3627
|
}
|
|
3603
3628
|
/**{zh}
|
|
3604
3629
|
* @hidden
|
|
3605
3630
|
* h265策略配置
|
|
3606
|
-
* @detail
|
|
3631
|
+
* @detail Options
|
|
3607
3632
|
*/
|
|
3608
3633
|
export declare type IH265Config = {
|
|
3609
3634
|
/**
|
|
@@ -3617,7 +3642,7 @@ export declare type IH265Config = {
|
|
|
3617
3642
|
} & VeStrategyH265Config;
|
|
3618
3643
|
/**{zh}
|
|
3619
3644
|
* 预加载初始配置
|
|
3620
|
-
* @detail
|
|
3645
|
+
* @detail Options
|
|
3621
3646
|
*/
|
|
3622
3647
|
export declare type IPreloadConfig = {
|
|
3623
3648
|
/**
|
|
@@ -3655,12 +3680,25 @@ export declare type IPreloadConfig = {
|
|
|
3655
3680
|
disabled?: boolean;
|
|
3656
3681
|
};
|
|
3657
3682
|
/**{zh}
|
|
3658
|
-
*
|
|
3683
|
+
* Range拆分(动态Buffer)策略初始配置
|
|
3659
3684
|
* @detail detail
|
|
3660
3685
|
*/
|
|
3686
|
+
export declare type IAdaptRangeConfig = {
|
|
3687
|
+
/**
|
|
3688
|
+
* 预加载依赖Module
|
|
3689
|
+
*/
|
|
3690
|
+
Strategy?: any;
|
|
3691
|
+
/**
|
|
3692
|
+
* 是否禁用Range拆分策略
|
|
3693
|
+
*/
|
|
3694
|
+
disabled?: boolean;
|
|
3695
|
+
};
|
|
3696
|
+
/**{zh}
|
|
3697
|
+
* 高级能力(策略)配置
|
|
3698
|
+
* @detail Options
|
|
3699
|
+
*/
|
|
3661
3700
|
export declare type StrategyConfigOptions = {
|
|
3662
3701
|
/**
|
|
3663
|
-
* @hidden
|
|
3664
3702
|
* h265策略配置
|
|
3665
3703
|
*/
|
|
3666
3704
|
[StrategyNames.H265]?: boolean | IH265Config;
|
|
@@ -3668,10 +3706,14 @@ export declare type StrategyConfigOptions = {
|
|
|
3668
3706
|
* 预加载配置
|
|
3669
3707
|
*/
|
|
3670
3708
|
[StrategyNames.PRELOAD]?: boolean | IPreloadConfig;
|
|
3709
|
+
/**
|
|
3710
|
+
* Range拆分(动态Buffer)
|
|
3711
|
+
*/
|
|
3712
|
+
[StrategyNames.ADAPT_RANGE]?: boolean | IAdaptRangeConfig;
|
|
3671
3713
|
};
|
|
3672
3714
|
/**{zh}
|
|
3673
3715
|
* 播放器预初始化配置
|
|
3674
|
-
* @detail
|
|
3716
|
+
* @detail Options
|
|
3675
3717
|
*/
|
|
3676
3718
|
export declare type StrategyInitOptions = {
|
|
3677
3719
|
/**
|
|
@@ -3697,7 +3739,7 @@ export declare type StrategyInitOptions = {
|
|
|
3697
3739
|
};
|
|
3698
3740
|
/**{zh}
|
|
3699
3741
|
* 预加载实例,通过预加载实例可执行一些高级方法
|
|
3700
|
-
* @detail
|
|
3742
|
+
* @detail Options
|
|
3701
3743
|
*/
|
|
3702
3744
|
export declare type PreloaderManager = {
|
|
3703
3745
|
/**
|
|
@@ -3733,7 +3775,7 @@ declare enum PreloaderStatus {
|
|
|
3733
3775
|
}
|
|
3734
3776
|
/**{zh}
|
|
3735
3777
|
* 预加载配置更新
|
|
3736
|
-
* @detail
|
|
3778
|
+
* @detail Options
|
|
3737
3779
|
*/
|
|
3738
3780
|
export declare type IPreloadUpdateConfig = {
|
|
3739
3781
|
/**
|
|
@@ -3747,7 +3789,7 @@ export declare type IPreloadUpdateConfig = {
|
|
|
3747
3789
|
};
|
|
3748
3790
|
/**{zh}
|
|
3749
3791
|
* 预加载视频资源
|
|
3750
|
-
* @detail
|
|
3792
|
+
* @detail Options
|
|
3751
3793
|
*/
|
|
3752
3794
|
export declare type IPreloadStream = {
|
|
3753
3795
|
/**
|
|
@@ -3812,12 +3854,79 @@ declare class VeStrategyWrapper {
|
|
|
3812
3854
|
prepare(): Promise<boolean>;
|
|
3813
3855
|
getDeviceId(): string;
|
|
3814
3856
|
isReady(): boolean;
|
|
3815
|
-
getStrategyRecommendations(): StrategyRecommendation;
|
|
3816
|
-
getStrategyRecommendationsAsync(): Promise<StrategyRecommendation>;
|
|
3857
|
+
getStrategyRecommendations(options?: any, commonOptions?: any): StrategyRecommendation;
|
|
3858
|
+
getStrategyRecommendationsAsync(options?: any, commonOptions?: any): Promise<StrategyRecommendation>;
|
|
3817
3859
|
isHevcRecommended(): boolean;
|
|
3818
3860
|
private initPreloaderConfig;
|
|
3819
3861
|
}
|
|
3820
3862
|
declare const _default: VeStrategyWrapper;
|
|
3863
|
+
export declare type IRes = IGetPlayInfoRes & {
|
|
3864
|
+
Data: IGetPlayInfoRes & {
|
|
3865
|
+
VideoID?: string;
|
|
3866
|
+
};
|
|
3867
|
+
};
|
|
3868
|
+
export interface IDefItem extends Stream {
|
|
3869
|
+
vid: string;
|
|
3870
|
+
lineId?: number;
|
|
3871
|
+
lineName?: string;
|
|
3872
|
+
url: string;
|
|
3873
|
+
streamType: string;
|
|
3874
|
+
backupUrl: string;
|
|
3875
|
+
backUrlList: string[];
|
|
3876
|
+
fileType?: "video" | "audio" | "evideo" | "eaudio";
|
|
3877
|
+
format: string;
|
|
3878
|
+
bitrate?: number;
|
|
3879
|
+
size?: number;
|
|
3880
|
+
kid?: string;
|
|
3881
|
+
vwidth?: number;
|
|
3882
|
+
vheight?: number;
|
|
3883
|
+
}
|
|
3884
|
+
export interface VideoInfoRes {
|
|
3885
|
+
playList: IDefItem[];
|
|
3886
|
+
type?: string;
|
|
3887
|
+
poster: string;
|
|
3888
|
+
vid: string;
|
|
3889
|
+
duration: number;
|
|
3890
|
+
dashOpts: IRes | {
|
|
3891
|
+
Data: IRes;
|
|
3892
|
+
};
|
|
3893
|
+
thumbs: IThumbInfoItem[];
|
|
3894
|
+
barrageMaskUrl: string;
|
|
3895
|
+
enableAdaptive?: boolean;
|
|
3896
|
+
adaptiveBitrateStreamingInfo?: ABRInfo;
|
|
3897
|
+
}
|
|
3898
|
+
declare function isMSESupport(mime?: string): boolean;
|
|
3899
|
+
export interface IAdaptRangeDefaultOptions {
|
|
3900
|
+
maxTargetCacheDur: number;
|
|
3901
|
+
minTargetCacheDur: number;
|
|
3902
|
+
rangeMaxDuration: number;
|
|
3903
|
+
rangeMinDuration: number;
|
|
3904
|
+
cacheSafeFactor: number;
|
|
3905
|
+
estPTcontrol: boolean;
|
|
3906
|
+
estPlayTime: number;
|
|
3907
|
+
minBandwidth: number;
|
|
3908
|
+
minDangerThreshold: number;
|
|
3909
|
+
rangeControl: boolean;
|
|
3910
|
+
rangeMinSize: number;
|
|
3911
|
+
safeFactor: number;
|
|
3912
|
+
targetCacheControl: boolean;
|
|
3913
|
+
}
|
|
3914
|
+
declare abstract class AbstractBaseAdapter {
|
|
3915
|
+
isLive: boolean;
|
|
3916
|
+
playerData: PlayerData;
|
|
3917
|
+
streamType: string;
|
|
3918
|
+
constructor(options: any);
|
|
3919
|
+
abstract canOpenAbr(): boolean;
|
|
3920
|
+
abstract applyAbrPluginConfig(_finalOptions: any, _autoBitrateOpts: any): void;
|
|
3921
|
+
abstract prepareAbrModule(_playerData: any, _sdkUmdLoader: any): void;
|
|
3922
|
+
abstract needAbrAutoDefinition(): boolean;
|
|
3923
|
+
abstract setAbrDefaultDefiWithAuto(): boolean;
|
|
3924
|
+
abstract generatePlaylistFromServer(res: VideoInfoRes): Stream[];
|
|
3925
|
+
abstract canAdaptRangeEnable(): boolean;
|
|
3926
|
+
abstract adaptRangeDefaultOptions(): IAdaptRangeDefaultOptions | undefined;
|
|
3927
|
+
abstract applyAdaptRangePluginConfig(_finalOptions: any, _adaptRangeOptions: any): void;
|
|
3928
|
+
abstract applyAdaptRangeStrategy(_finalOptions: any, _adaptRangeOptions: any): void;
|
|
3929
|
+
}
|
|
3821
3930
|
declare class PlayerData {
|
|
3822
3931
|
id?: string;
|
|
3823
3932
|
root?: HTMLElement;
|
|
@@ -3861,6 +3970,8 @@ declare class PlayerData {
|
|
|
3861
3970
|
urlExpireDiff: number;
|
|
3862
3971
|
urlCheckExpireInterval: number;
|
|
3863
3972
|
};
|
|
3973
|
+
private isAutoBitrateEnable;
|
|
3974
|
+
adapter: AbstractBaseAdapter;
|
|
3864
3975
|
isBusinessDrm: boolean;
|
|
3865
3976
|
isEncrypt: boolean;
|
|
3866
3977
|
dashOpts: {
|
|
@@ -3873,6 +3984,12 @@ declare class PlayerData {
|
|
|
3873
3984
|
*/
|
|
3874
3985
|
initPlayData(configs: IPlayerConfig): void;
|
|
3875
3986
|
initPlaylistAndGetCurrent(configs: IPlayerConfig): Stream;
|
|
3987
|
+
checkAutoBitratePlayList(): boolean;
|
|
3988
|
+
getABRStreamInfo(streamType: any, originDefaultStream: any): {
|
|
3989
|
+
defaultDefinition: string;
|
|
3990
|
+
defaultStream: any;
|
|
3991
|
+
playList: Stream[];
|
|
3992
|
+
};
|
|
3876
3993
|
isCurrentH265(): boolean;
|
|
3877
3994
|
getCurrentByDefaultConfig(): Stream;
|
|
3878
3995
|
initCurrent(currentStreams: Stream): void;
|
|
@@ -3889,12 +4006,13 @@ declare class PlayerData {
|
|
|
3889
4006
|
* @description: 获取当前直播url
|
|
3890
4007
|
*/
|
|
3891
4008
|
getCurrentUrl(): Url;
|
|
4009
|
+
getTargetStreamType(stream?: Stream): string;
|
|
3892
4010
|
/**
|
|
3893
4011
|
* @description: 获取当前的streamType
|
|
3894
4012
|
*/
|
|
3895
4013
|
getCurrentStreamType(): string;
|
|
3896
4014
|
getStreamType(): string;
|
|
3897
|
-
isOpenABR(
|
|
4015
|
+
isOpenABR(): boolean;
|
|
3898
4016
|
showRealDefinition(): boolean;
|
|
3899
4017
|
isAutoDefinition(def: any): boolean;
|
|
3900
4018
|
isPlayAutoDefinition(def?: string): boolean;
|
|
@@ -3948,7 +4066,6 @@ declare class PlayerData {
|
|
|
3948
4066
|
*/
|
|
3949
4067
|
updatePlayList(): void;
|
|
3950
4068
|
}
|
|
3951
|
-
declare function isMSESupport(mime?: string): boolean;
|
|
3952
4069
|
/**
|
|
3953
4070
|
* @hidden
|
|
3954
4071
|
* @brief 移动端交互面板配置
|
|
@@ -3998,6 +4115,7 @@ declare enum UmdKeys {
|
|
|
3998
4115
|
VeStrategy = "vestrategy",
|
|
3999
4116
|
VeStrategyH265 = "vestrategy_h265",
|
|
4000
4117
|
VeStrategyPreload = "vestrategy_preload",
|
|
4118
|
+
VeStrategyAdaptRange = "vestrategy_adapt_range",
|
|
4001
4119
|
DashAbralgo = "DashAbralgo",
|
|
4002
4120
|
Preloader = "preloader"
|
|
4003
4121
|
}
|
|
@@ -4165,6 +4283,7 @@ declare class VePlayer {
|
|
|
4165
4283
|
* @memberof VePlayer
|
|
4166
4284
|
*/
|
|
4167
4285
|
sdkUmdLoader: umdLoader;
|
|
4286
|
+
private adapter;
|
|
4168
4287
|
/**
|
|
4169
4288
|
* @hidden
|
|
4170
4289
|
*/
|
|
@@ -4183,33 +4302,33 @@ declare class VePlayer {
|
|
|
4183
4302
|
* @memberof VePlayer
|
|
4184
4303
|
*/
|
|
4185
4304
|
static sdkVersion: string;
|
|
4186
|
-
/**{zh}
|
|
4187
|
-
* @brief
|
|
4305
|
+
/** {zh}
|
|
4306
|
+
* @brief 播放策略预初始化配置
|
|
4188
4307
|
* @param options 初始化配置,详情见{@link StrategyInitOptions}
|
|
4189
4308
|
*/
|
|
4190
4309
|
static prepare(options: StrategyInitOptions): Promise<void>;
|
|
4191
|
-
/**{zh}
|
|
4310
|
+
/** {zh}
|
|
4192
4311
|
* @brief 设置预加载模式
|
|
4193
4312
|
* @param preloadScene 预加载模式,详情见{@link PreloadScene}
|
|
4194
4313
|
* @param options 预加载配置更新,详情见{@link IPreloadUpdateConfig}
|
|
4195
4314
|
*/
|
|
4196
4315
|
static setPreloadScene(preloadScene: PreloadScene, options?: IPreloadUpdateConfig): void;
|
|
4197
|
-
/**{zh}
|
|
4316
|
+
/** {zh}
|
|
4198
4317
|
* @brief 获取预加载实例,可通过预加载实例执行高级方法,需在VePlayer.prepare Promise执行完成之后才能获取到预加载实例
|
|
4199
4318
|
* @returns 预加载实例,详情见{@link PreloaderManager}
|
|
4200
4319
|
*/
|
|
4201
4320
|
static get preloader(): PreloaderManager | undefined;
|
|
4202
|
-
/**{zh}
|
|
4321
|
+
/** {zh}
|
|
4203
4322
|
* @brief 获取当前预加载实例状态
|
|
4204
4323
|
* @returns 预加载实例状态,详情见{@link PreloaderStatus}
|
|
4205
4324
|
*/
|
|
4206
4325
|
static get preloaderStatus(): PreloaderStatus;
|
|
4207
|
-
/**{zh}
|
|
4326
|
+
/** {zh}
|
|
4208
4327
|
* @brief 添加待预加载视频列表
|
|
4209
4328
|
* @param list 待预加载视频列表,详情见{@link IPreloadStream[]}。
|
|
4210
4329
|
*/
|
|
4211
4330
|
static addPreloadList(list: IPreloadStream[]): void;
|
|
4212
|
-
/**{zh}
|
|
4331
|
+
/** {zh}
|
|
4213
4332
|
* @brief 设置待预加载视频列表,替换当前已设置的待预加载列表
|
|
4214
4333
|
* @param list 待预加载视频列表,详情见{@link IPreloadStream[]}
|
|
4215
4334
|
*/
|
|
@@ -4518,9 +4637,7 @@ declare class VePlayer {
|
|
|
4518
4637
|
* @notes 更换后,会从更换前的时间点继续播放。
|
|
4519
4638
|
* @param url 视频播放地址。
|
|
4520
4639
|
*/
|
|
4521
|
-
switchURL(url: Url
|
|
4522
|
-
seamless?: boolean;
|
|
4523
|
-
}): Promise<void>;
|
|
4640
|
+
switchURL(url: Url): Promise<void>;
|
|
4524
4641
|
/** {zh}
|
|
4525
4642
|
* @memberof VePlayer
|
|
4526
4643
|
* @brief 针对不同格式的视频,重建播放器内核播放下一个视频。
|