@volcengine/veplayer 1.9.6-rc.0 → 1.9.6-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 +141 -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,77 @@ 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
|
+
};
|
|
3866
|
+
export interface IDefItem extends Stream {
|
|
3867
|
+
vid: string;
|
|
3868
|
+
lineId?: number;
|
|
3869
|
+
lineName?: string;
|
|
3870
|
+
url: string;
|
|
3871
|
+
streamType: string;
|
|
3872
|
+
backupUrl: string;
|
|
3873
|
+
backUrlList: string[];
|
|
3874
|
+
fileType?: "video" | "audio" | "evideo" | "eaudio";
|
|
3875
|
+
format: string;
|
|
3876
|
+
bitrate?: number;
|
|
3877
|
+
size?: number;
|
|
3878
|
+
kid?: string;
|
|
3879
|
+
vwidth?: number;
|
|
3880
|
+
vheight?: number;
|
|
3881
|
+
}
|
|
3882
|
+
export interface VideoInfoRes {
|
|
3883
|
+
playList: IDefItem[];
|
|
3884
|
+
type?: string;
|
|
3885
|
+
poster: string;
|
|
3886
|
+
vid: string;
|
|
3887
|
+
duration: number;
|
|
3888
|
+
dashOpts: IRes | {
|
|
3889
|
+
Data: IRes;
|
|
3890
|
+
};
|
|
3891
|
+
thumbs: IThumbInfoItem[];
|
|
3892
|
+
barrageMaskUrl: string;
|
|
3893
|
+
enableAdaptive?: boolean;
|
|
3894
|
+
adaptiveBitrateStreamingInfo?: ABRInfo;
|
|
3895
|
+
}
|
|
3896
|
+
declare function isMSESupport(mime?: string): boolean;
|
|
3897
|
+
export interface IAdaptRangeDefaultOptions {
|
|
3898
|
+
maxTargetCacheDur: number;
|
|
3899
|
+
minTargetCacheDur: number;
|
|
3900
|
+
rangeMaxDuration: number;
|
|
3901
|
+
rangeMinDuration: number;
|
|
3902
|
+
cacheSafeFactor: number;
|
|
3903
|
+
estPTcontrol: boolean;
|
|
3904
|
+
estPlayTime: number;
|
|
3905
|
+
minBandwidth: number;
|
|
3906
|
+
minDangerThreshold: number;
|
|
3907
|
+
rangeControl: boolean;
|
|
3908
|
+
rangeMinSize: number;
|
|
3909
|
+
safeFactor: number;
|
|
3910
|
+
targetCacheControl: boolean;
|
|
3911
|
+
}
|
|
3912
|
+
declare abstract class AbstractBaseAdapter {
|
|
3913
|
+
isLive: boolean;
|
|
3914
|
+
playerData: PlayerData;
|
|
3915
|
+
streamType: string;
|
|
3916
|
+
constructor(options: any);
|
|
3917
|
+
abstract canOpenAbr(): boolean;
|
|
3918
|
+
abstract applyAbrPluginConfig(_finalOptions: any, _autoBitrateOpts: any): void;
|
|
3919
|
+
abstract prepareAbrModule(_playerData: any, _sdkUmdLoader: any): void;
|
|
3920
|
+
abstract needAbrAutoDefinition(): boolean;
|
|
3921
|
+
abstract setAbrDefaultDefiWithAuto(): boolean;
|
|
3922
|
+
abstract generatePlaylistFromServer(res: VideoInfoRes): Stream[];
|
|
3923
|
+
abstract canAdaptRangeEnable(): boolean;
|
|
3924
|
+
abstract adaptRangeDefaultOptions(): IAdaptRangeDefaultOptions | undefined;
|
|
3925
|
+
abstract applyAdaptRangePluginConfig(_finalOptions: any, _adaptRangeOptions: any): void;
|
|
3926
|
+
abstract applyAdaptRangeStrategy(_finalOptions: any, _adaptRangeOptions: any): void;
|
|
3927
|
+
}
|
|
3821
3928
|
declare class PlayerData {
|
|
3822
3929
|
id?: string;
|
|
3823
3930
|
root?: HTMLElement;
|
|
@@ -3861,6 +3968,8 @@ declare class PlayerData {
|
|
|
3861
3968
|
urlExpireDiff: number;
|
|
3862
3969
|
urlCheckExpireInterval: number;
|
|
3863
3970
|
};
|
|
3971
|
+
private isAutoBitrateEnable;
|
|
3972
|
+
adapter: AbstractBaseAdapter;
|
|
3864
3973
|
isBusinessDrm: boolean;
|
|
3865
3974
|
isEncrypt: boolean;
|
|
3866
3975
|
dashOpts: {
|
|
@@ -3873,6 +3982,12 @@ declare class PlayerData {
|
|
|
3873
3982
|
*/
|
|
3874
3983
|
initPlayData(configs: IPlayerConfig): void;
|
|
3875
3984
|
initPlaylistAndGetCurrent(configs: IPlayerConfig): Stream;
|
|
3985
|
+
checkAutoBitratePlayList(): boolean;
|
|
3986
|
+
getABRStreamInfo(streamType: any, originDefaultStream: any): {
|
|
3987
|
+
defaultDefinition: string;
|
|
3988
|
+
defaultStream: any;
|
|
3989
|
+
playList: Stream[];
|
|
3990
|
+
};
|
|
3876
3991
|
isCurrentH265(): boolean;
|
|
3877
3992
|
getCurrentByDefaultConfig(): Stream;
|
|
3878
3993
|
initCurrent(currentStreams: Stream): void;
|
|
@@ -3889,12 +4004,13 @@ declare class PlayerData {
|
|
|
3889
4004
|
* @description: 获取当前直播url
|
|
3890
4005
|
*/
|
|
3891
4006
|
getCurrentUrl(): Url;
|
|
4007
|
+
getTargetStreamType(stream?: Stream): string;
|
|
3892
4008
|
/**
|
|
3893
4009
|
* @description: 获取当前的streamType
|
|
3894
4010
|
*/
|
|
3895
4011
|
getCurrentStreamType(): string;
|
|
3896
4012
|
getStreamType(): string;
|
|
3897
|
-
isOpenABR(
|
|
4013
|
+
isOpenABR(): boolean;
|
|
3898
4014
|
showRealDefinition(): boolean;
|
|
3899
4015
|
isAutoDefinition(def: any): boolean;
|
|
3900
4016
|
isPlayAutoDefinition(def?: string): boolean;
|
|
@@ -3948,7 +4064,6 @@ declare class PlayerData {
|
|
|
3948
4064
|
*/
|
|
3949
4065
|
updatePlayList(): void;
|
|
3950
4066
|
}
|
|
3951
|
-
declare function isMSESupport(mime?: string): boolean;
|
|
3952
4067
|
/**
|
|
3953
4068
|
* @hidden
|
|
3954
4069
|
* @brief 移动端交互面板配置
|
|
@@ -3998,6 +4113,7 @@ declare enum UmdKeys {
|
|
|
3998
4113
|
VeStrategy = "vestrategy",
|
|
3999
4114
|
VeStrategyH265 = "vestrategy_h265",
|
|
4000
4115
|
VeStrategyPreload = "vestrategy_preload",
|
|
4116
|
+
VeStrategyAdaptRange = "vestrategy_adapt_range",
|
|
4001
4117
|
DashAbralgo = "DashAbralgo",
|
|
4002
4118
|
Preloader = "preloader"
|
|
4003
4119
|
}
|
|
@@ -4165,6 +4281,7 @@ declare class VePlayer {
|
|
|
4165
4281
|
* @memberof VePlayer
|
|
4166
4282
|
*/
|
|
4167
4283
|
sdkUmdLoader: umdLoader;
|
|
4284
|
+
private adapter;
|
|
4168
4285
|
/**
|
|
4169
4286
|
* @hidden
|
|
4170
4287
|
*/
|
|
@@ -4183,33 +4300,33 @@ declare class VePlayer {
|
|
|
4183
4300
|
* @memberof VePlayer
|
|
4184
4301
|
*/
|
|
4185
4302
|
static sdkVersion: string;
|
|
4186
|
-
/**{zh}
|
|
4187
|
-
* @brief
|
|
4303
|
+
/** {zh}
|
|
4304
|
+
* @brief 播放策略预初始化配置
|
|
4188
4305
|
* @param options 初始化配置,详情见{@link StrategyInitOptions}
|
|
4189
4306
|
*/
|
|
4190
4307
|
static prepare(options: StrategyInitOptions): Promise<void>;
|
|
4191
|
-
/**{zh}
|
|
4308
|
+
/** {zh}
|
|
4192
4309
|
* @brief 设置预加载模式
|
|
4193
4310
|
* @param preloadScene 预加载模式,详情见{@link PreloadScene}
|
|
4194
4311
|
* @param options 预加载配置更新,详情见{@link IPreloadUpdateConfig}
|
|
4195
4312
|
*/
|
|
4196
4313
|
static setPreloadScene(preloadScene: PreloadScene, options?: IPreloadUpdateConfig): void;
|
|
4197
|
-
/**{zh}
|
|
4314
|
+
/** {zh}
|
|
4198
4315
|
* @brief 获取预加载实例,可通过预加载实例执行高级方法,需在VePlayer.prepare Promise执行完成之后才能获取到预加载实例
|
|
4199
4316
|
* @returns 预加载实例,详情见{@link PreloaderManager}
|
|
4200
4317
|
*/
|
|
4201
4318
|
static get preloader(): PreloaderManager | undefined;
|
|
4202
|
-
/**{zh}
|
|
4319
|
+
/** {zh}
|
|
4203
4320
|
* @brief 获取当前预加载实例状态
|
|
4204
4321
|
* @returns 预加载实例状态,详情见{@link PreloaderStatus}
|
|
4205
4322
|
*/
|
|
4206
4323
|
static get preloaderStatus(): PreloaderStatus;
|
|
4207
|
-
/**{zh}
|
|
4324
|
+
/** {zh}
|
|
4208
4325
|
* @brief 添加待预加载视频列表
|
|
4209
4326
|
* @param list 待预加载视频列表,详情见{@link IPreloadStream[]}。
|
|
4210
4327
|
*/
|
|
4211
4328
|
static addPreloadList(list: IPreloadStream[]): void;
|
|
4212
|
-
/**{zh}
|
|
4329
|
+
/** {zh}
|
|
4213
4330
|
* @brief 设置待预加载视频列表,替换当前已设置的待预加载列表
|
|
4214
4331
|
* @param list 待预加载视频列表,详情见{@link IPreloadStream[]}
|
|
4215
4332
|
*/
|
|
@@ -4518,9 +4635,7 @@ declare class VePlayer {
|
|
|
4518
4635
|
* @notes 更换后,会从更换前的时间点继续播放。
|
|
4519
4636
|
* @param url 视频播放地址。
|
|
4520
4637
|
*/
|
|
4521
|
-
switchURL(url: Url
|
|
4522
|
-
seamless?: boolean;
|
|
4523
|
-
}): Promise<void>;
|
|
4638
|
+
switchURL(url: Url): Promise<void>;
|
|
4524
4639
|
/** {zh}
|
|
4525
4640
|
* @memberof VePlayer
|
|
4526
4641
|
* @brief 针对不同格式的视频,重建播放器内核播放下一个视频。
|