@volcengine/veplayer 1.8.6-rc.15 → 1.8.6-rc.17
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 +168 -171
- package/index.min.js +2 -2
- package/package.json +1 -1
- package/plugin/hlsEncrypt.js +2 -2
package/index.d.ts
CHANGED
|
@@ -780,62 +780,81 @@ export interface ITextItem {
|
|
|
780
780
|
/**
|
|
781
781
|
* @brief 清晰度自动降级配置
|
|
782
782
|
* @list Options
|
|
783
|
-
* @
|
|
784
|
-
*
|
|
785
|
-
* @export
|
|
786
|
-
* @interface IDefinitionDemotePlugin
|
|
783
|
+
* @kind property
|
|
787
784
|
*/
|
|
788
785
|
export interface IDefinitionDemotePlugin {
|
|
789
786
|
/**
|
|
790
|
-
*
|
|
791
|
-
*
|
|
787
|
+
* @brief 是否自动触发降级
|
|
788
|
+
* @default true
|
|
792
789
|
*
|
|
793
|
-
* @type {boolean}
|
|
794
|
-
* @memberof IDefinitionDemotePlugin
|
|
795
790
|
*/
|
|
796
791
|
isNeedAutoDemote?: boolean;
|
|
797
792
|
/**
|
|
798
|
-
* @brief
|
|
799
|
-
* @default
|
|
800
|
-
*/
|
|
801
|
-
isNeedShowTips?: boolean;
|
|
802
|
-
/**
|
|
803
|
-
* @brief 提醒降级的toast显示持续时间
|
|
804
|
-
*/
|
|
805
|
-
toastShowTime?: number;
|
|
806
|
-
/**
|
|
807
|
-
*
|
|
808
|
-
* 降级顺序,按照数组顺序依次降级,数字元素对应playList中的definition
|
|
809
|
-
* 默认: ['uhd', 'hd', 'sd', 'ld', 'ao']
|
|
793
|
+
* @brief 降级顺序,按照数组 顺序依次降级,数组 中的元素与playList 中的 definition 相对应
|
|
794
|
+
* @default []
|
|
810
795
|
*
|
|
811
796
|
* @type {string[]}
|
|
812
797
|
* @memberof IDefinitionDemotePlugin
|
|
813
798
|
*/
|
|
814
799
|
demotePriority?: string[];
|
|
815
800
|
/**
|
|
816
|
-
*
|
|
817
|
-
*
|
|
801
|
+
* @brief 长时间卡顿的时间阈值,单位为ms。卡顿超过该值,即为长时间卡顿
|
|
802
|
+
* @default 5000
|
|
818
803
|
*
|
|
819
|
-
* @type {number}
|
|
820
|
-
* @memberof IDefinitionDemotePlugin
|
|
821
804
|
*/
|
|
822
805
|
longWaitingTime?: number;
|
|
823
806
|
/**
|
|
824
|
-
*
|
|
825
|
-
*
|
|
807
|
+
* @brief 频繁卡顿的次数阈值。OftenWaitingTime 内卡顿次数大于等于阈值时,触发often_waiting事件,即表示发生了频繁卡顿
|
|
808
|
+
* @default 3
|
|
826
809
|
*
|
|
827
|
-
* @type {number}
|
|
828
|
-
* @memberof IDefinitionDemotePlugin
|
|
829
810
|
*/
|
|
830
811
|
oftenWaitingCount?: number;
|
|
831
812
|
/**
|
|
832
|
-
*
|
|
833
|
-
*
|
|
834
|
-
*
|
|
835
|
-
* @type {number}
|
|
836
|
-
* @memberof IDefinitionDemotePlugin
|
|
813
|
+
* @brief 频繁卡顿的时间范围。OftenWaitingTime 内卡顿次数大于等于阈值时,触发often_waiting事件,即表示发生了频繁卡顿
|
|
814
|
+
* @default 5000
|
|
837
815
|
*/
|
|
838
816
|
oftenWaitingTime?: number;
|
|
817
|
+
/**
|
|
818
|
+
* @brief 卡顿时是否显示建议切换清晰度的提醒tips
|
|
819
|
+
* @default true
|
|
820
|
+
*/
|
|
821
|
+
isNeedShowTips?: boolean;
|
|
822
|
+
/**
|
|
823
|
+
* @brief 提醒降级的toast显示持续时间,单位ms
|
|
824
|
+
* @default 3000
|
|
825
|
+
*/
|
|
826
|
+
toastShowTime?: number;
|
|
827
|
+
}
|
|
828
|
+
export declare class DefinitionDemotePlugin extends Plugin {
|
|
829
|
+
static get pluginName(): string;
|
|
830
|
+
waitings: number[];
|
|
831
|
+
timer: ReturnType<typeof setTimeout>;
|
|
832
|
+
toastId: number;
|
|
833
|
+
longWaitingEmitTime: number;
|
|
834
|
+
waitingStartTime: number;
|
|
835
|
+
playerData: PlayerData;
|
|
836
|
+
static get defaultConfig(): IDefinitionDemotePlugin;
|
|
837
|
+
constructor(args: any);
|
|
838
|
+
registerLanguageTexts(): {
|
|
839
|
+
definition_demote_txt: {
|
|
840
|
+
jp: string;
|
|
841
|
+
en: string;
|
|
842
|
+
zh: string;
|
|
843
|
+
"zh-hk": string;
|
|
844
|
+
};
|
|
845
|
+
};
|
|
846
|
+
afterCreate(): void;
|
|
847
|
+
bindCtx(): void;
|
|
848
|
+
bindEvents(): void;
|
|
849
|
+
_waiting(): void;
|
|
850
|
+
_count(): void;
|
|
851
|
+
_time(): void;
|
|
852
|
+
_clearTime(): void;
|
|
853
|
+
clearState(): void;
|
|
854
|
+
demote(): void;
|
|
855
|
+
changeUrl(url: string): void;
|
|
856
|
+
showToast(definition: Stream): void;
|
|
857
|
+
destroy(): void;
|
|
839
858
|
}
|
|
840
859
|
/**
|
|
841
860
|
* @brief DASH 播放配置。
|
|
@@ -1640,33 +1659,6 @@ export declare class PlayListPlugin extends Plugin {
|
|
|
1640
1659
|
get disable(): boolean;
|
|
1641
1660
|
render(): string;
|
|
1642
1661
|
}
|
|
1643
|
-
export interface IPlayInfoListItem {
|
|
1644
|
-
BackupPlayUrl: string;
|
|
1645
|
-
BackupUrlExpire: string;
|
|
1646
|
-
BarrageMaskOffset: string;
|
|
1647
|
-
Bitrate: number;
|
|
1648
|
-
CheckInfo: string;
|
|
1649
|
-
Codec: string;
|
|
1650
|
-
Definition: string;
|
|
1651
|
-
Duration: number;
|
|
1652
|
-
FileId: string;
|
|
1653
|
-
FileType: string;
|
|
1654
|
-
Format: string;
|
|
1655
|
-
Height: number;
|
|
1656
|
-
IndexRange: string;
|
|
1657
|
-
InitRange: string;
|
|
1658
|
-
KeyFrameAlignment: string;
|
|
1659
|
-
LogoType: string;
|
|
1660
|
-
MainPlayUrl: string;
|
|
1661
|
-
MainUrlExpire: string;
|
|
1662
|
-
Md5: string;
|
|
1663
|
-
PlayAuth: string;
|
|
1664
|
-
PlayAuthId: string;
|
|
1665
|
-
Quality: string;
|
|
1666
|
-
Size: number;
|
|
1667
|
-
Volume?: number;
|
|
1668
|
-
Width: number;
|
|
1669
|
-
}
|
|
1670
1662
|
/**
|
|
1671
1663
|
* @brief 动态水印配置。
|
|
1672
1664
|
* @list Options
|
|
@@ -1759,6 +1751,120 @@ export declare class DynamicWatermarkPlugin extends Plugin {
|
|
|
1759
1751
|
destroy(): void;
|
|
1760
1752
|
render(): string | HTMLElement;
|
|
1761
1753
|
}
|
|
1754
|
+
declare class ToastPlugin extends Plugin {
|
|
1755
|
+
static get pluginName(): string;
|
|
1756
|
+
static get defaultConfig(): {
|
|
1757
|
+
index: number;
|
|
1758
|
+
};
|
|
1759
|
+
constructor(args: any);
|
|
1760
|
+
private toastNumber;
|
|
1761
|
+
private toastMaps;
|
|
1762
|
+
beforePlayerInit(): void;
|
|
1763
|
+
afterPlayerInit(): void;
|
|
1764
|
+
afterCreate(): void;
|
|
1765
|
+
destroy(): void;
|
|
1766
|
+
add(content: string | HTMLElement, duration?: number, isNeedCloseBt?: boolean): number;
|
|
1767
|
+
remove(id: number): void;
|
|
1768
|
+
renderToast(content: string | HTMLElement, isNeedCloseBt: any, id: any): HTMLElement;
|
|
1769
|
+
render(): string;
|
|
1770
|
+
}
|
|
1771
|
+
/** {zh}
|
|
1772
|
+
* @brief 记忆播放配置。
|
|
1773
|
+
* @kind property
|
|
1774
|
+
* @list Options
|
|
1775
|
+
* @interface IMemoryPlayConfig
|
|
1776
|
+
*/
|
|
1777
|
+
export interface IMemoryPlayConfig {
|
|
1778
|
+
/** {zh}
|
|
1779
|
+
* @brief 存储标识id
|
|
1780
|
+
* @default options.vid || options.url
|
|
1781
|
+
*
|
|
1782
|
+
* @type {number | string}
|
|
1783
|
+
* @memberof IMemoryPlayConfig
|
|
1784
|
+
*/
|
|
1785
|
+
memoryId: number | string;
|
|
1786
|
+
/** {zh}
|
|
1787
|
+
* @brief 设置时间函数
|
|
1788
|
+
* @default -
|
|
1789
|
+
*
|
|
1790
|
+
* @type {(id: number | string, time: number) => unknown}
|
|
1791
|
+
* @memberof IMemoryPlayConfig
|
|
1792
|
+
*/
|
|
1793
|
+
saveTime?: (id: number | string, time: number) => unknown;
|
|
1794
|
+
/** {zh}
|
|
1795
|
+
* @brief 获取最后一次播放时间函数
|
|
1796
|
+
* @default -
|
|
1797
|
+
*/
|
|
1798
|
+
getTime?: (id: number | string) => number | Promise<number>;
|
|
1799
|
+
/** {zh}
|
|
1800
|
+
* @brief 判断是否播放了最小时间阈值,即如果播的时长太小,则不算做播放过,存储的时间进度为0
|
|
1801
|
+
* @default 1
|
|
1802
|
+
*/
|
|
1803
|
+
minStartTime?: number;
|
|
1804
|
+
/** {zh}
|
|
1805
|
+
* @brief 判断是否播放结束的最小时间阈值,即距离结束多少时间内算作播放结束,播放结束则不存储时间进度,且清空之前的进度为0
|
|
1806
|
+
* @default 1
|
|
1807
|
+
*/
|
|
1808
|
+
minEndTime?: number;
|
|
1809
|
+
}
|
|
1810
|
+
export declare class MemoryPlay extends Plugin {
|
|
1811
|
+
static get pluginName(): string;
|
|
1812
|
+
static get defaultConfig(): IMemoryPlayConfig;
|
|
1813
|
+
startTime: number;
|
|
1814
|
+
saveTimeFun: (id: number | string, time: number) => unknown;
|
|
1815
|
+
getTimeFun: (id: number | string) => number | Promise<number>;
|
|
1816
|
+
memoryId: number | string;
|
|
1817
|
+
shouldShowToast: boolean;
|
|
1818
|
+
constructor(args: any);
|
|
1819
|
+
registerLanguageTexts(): {
|
|
1820
|
+
preText: {
|
|
1821
|
+
jp: string;
|
|
1822
|
+
en: string;
|
|
1823
|
+
zh: string;
|
|
1824
|
+
"zh-hk": string;
|
|
1825
|
+
};
|
|
1826
|
+
};
|
|
1827
|
+
children(): {
|
|
1828
|
+
toast: typeof ToastPlugin;
|
|
1829
|
+
};
|
|
1830
|
+
afterCreate(): void;
|
|
1831
|
+
beforePlayerInit(): Promise<void>;
|
|
1832
|
+
getTime(): Promise<void>;
|
|
1833
|
+
saveTime(): void;
|
|
1834
|
+
visibilitychangeCallback(): void;
|
|
1835
|
+
setSave(): void;
|
|
1836
|
+
showToast(): void;
|
|
1837
|
+
saveTimeByStorage(memoryId: string, time: number): void;
|
|
1838
|
+
getTimeByStorage(memoryId: string): string | 0;
|
|
1839
|
+
destroy(): void;
|
|
1840
|
+
}
|
|
1841
|
+
export interface IPlayInfoListItem {
|
|
1842
|
+
BackupPlayUrl: string;
|
|
1843
|
+
BackupUrlExpire: string;
|
|
1844
|
+
BarrageMaskOffset: string;
|
|
1845
|
+
Bitrate: number;
|
|
1846
|
+
CheckInfo: string;
|
|
1847
|
+
Codec: string;
|
|
1848
|
+
Definition: string;
|
|
1849
|
+
Duration: number;
|
|
1850
|
+
FileId: string;
|
|
1851
|
+
FileType: string;
|
|
1852
|
+
Format: string;
|
|
1853
|
+
Height: number;
|
|
1854
|
+
IndexRange: string;
|
|
1855
|
+
InitRange: string;
|
|
1856
|
+
KeyFrameAlignment: string;
|
|
1857
|
+
LogoType: string;
|
|
1858
|
+
MainPlayUrl: string;
|
|
1859
|
+
MainUrlExpire: string;
|
|
1860
|
+
Md5: string;
|
|
1861
|
+
PlayAuth: string;
|
|
1862
|
+
PlayAuthId: string;
|
|
1863
|
+
Quality: string;
|
|
1864
|
+
Size: number;
|
|
1865
|
+
Volume?: number;
|
|
1866
|
+
Width: number;
|
|
1867
|
+
}
|
|
1762
1868
|
declare enum CodecType {
|
|
1763
1869
|
/** {zh}
|
|
1764
1870
|
* @brief H.265
|
|
@@ -2453,7 +2559,8 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
2453
2559
|
*/
|
|
2454
2560
|
disableVodLogOptsCheck?: boolean;
|
|
2455
2561
|
/** {zh}
|
|
2456
|
-
* @
|
|
2562
|
+
* @hidden
|
|
2563
|
+
* @brief 是否打开日志打印
|
|
2457
2564
|
* @default false
|
|
2458
2565
|
*/
|
|
2459
2566
|
debug?: boolean;
|
|
@@ -2806,35 +2913,6 @@ export interface IAutoBitrateOptsConfig {
|
|
|
2806
2913
|
*/
|
|
2807
2914
|
module?: any;
|
|
2808
2915
|
}
|
|
2809
|
-
/** {zh}
|
|
2810
|
-
* @brief 记忆播放配置。
|
|
2811
|
-
* @kind property
|
|
2812
|
-
* @list Options
|
|
2813
|
-
* @interface IMemoryPlayConfig
|
|
2814
|
-
*/
|
|
2815
|
-
export interface IMemoryPlayConfig {
|
|
2816
|
-
/** {zh}
|
|
2817
|
-
* @brief 存储标识id
|
|
2818
|
-
* @default options.vid || options.url
|
|
2819
|
-
*
|
|
2820
|
-
* @type {number | string}
|
|
2821
|
-
* @memberof IMemoryPlayConfig
|
|
2822
|
-
*/
|
|
2823
|
-
memoryId: number | string;
|
|
2824
|
-
/** {zh}
|
|
2825
|
-
* @brief 设置时间函数
|
|
2826
|
-
* @default -
|
|
2827
|
-
*
|
|
2828
|
-
* @type {(id: number | string, time: number) => unknown}
|
|
2829
|
-
* @memberof IMemoryPlayConfig
|
|
2830
|
-
*/
|
|
2831
|
-
saveTime?: (id: number | string, time: number) => unknown;
|
|
2832
|
-
/** {zh}
|
|
2833
|
-
* @brief 获取最后一次播放时间函数
|
|
2834
|
-
* @default -
|
|
2835
|
-
*/
|
|
2836
|
-
getTime?: (id: number | string) => number | Promise<number>;
|
|
2837
|
-
}
|
|
2838
2916
|
/** {zh}
|
|
2839
2917
|
* @brief 插件按钮位置
|
|
2840
2918
|
*/
|
|
@@ -4264,37 +4342,6 @@ export declare class Subtitle extends Plugin {
|
|
|
4264
4342
|
destroy(): void;
|
|
4265
4343
|
render(): string;
|
|
4266
4344
|
}
|
|
4267
|
-
export declare class DefinitionDemotePlugin extends Plugin {
|
|
4268
|
-
static get pluginName(): string;
|
|
4269
|
-
waitings: number[];
|
|
4270
|
-
timer: ReturnType<typeof setTimeout>;
|
|
4271
|
-
toastId: number;
|
|
4272
|
-
longWaitingEmitTime: number;
|
|
4273
|
-
waitingStartTime: number;
|
|
4274
|
-
playerData: PlayerData;
|
|
4275
|
-
static get defaultConfig(): IDefinitionDemotePlugin;
|
|
4276
|
-
constructor(args: any);
|
|
4277
|
-
registerLanguageTexts(): {
|
|
4278
|
-
definition_demote_txt: {
|
|
4279
|
-
jp: string;
|
|
4280
|
-
en: string;
|
|
4281
|
-
zh: string;
|
|
4282
|
-
"zh-hk": string;
|
|
4283
|
-
};
|
|
4284
|
-
};
|
|
4285
|
-
afterCreate(): void;
|
|
4286
|
-
bindCtx(): void;
|
|
4287
|
-
bindEvents(): void;
|
|
4288
|
-
_waiting(): void;
|
|
4289
|
-
_count(): void;
|
|
4290
|
-
_time(): void;
|
|
4291
|
-
_clearTime(): void;
|
|
4292
|
-
clearState(): void;
|
|
4293
|
-
demote(): void;
|
|
4294
|
-
changeUrl(url: string): void;
|
|
4295
|
-
showToast(definition: Stream): void;
|
|
4296
|
-
destroy(): void;
|
|
4297
|
-
}
|
|
4298
4345
|
export declare class TimeShiftPlugin extends Plugin {
|
|
4299
4346
|
static get pluginName(): string;
|
|
4300
4347
|
static get defaultConfig(): {
|
|
@@ -4407,56 +4454,6 @@ export declare class MirrorPlugin extends Plugin {
|
|
|
4407
4454
|
destroy(): void;
|
|
4408
4455
|
render(): string;
|
|
4409
4456
|
}
|
|
4410
|
-
declare class ToastPlugin extends Plugin {
|
|
4411
|
-
static get pluginName(): string;
|
|
4412
|
-
static get defaultConfig(): {
|
|
4413
|
-
index: number;
|
|
4414
|
-
};
|
|
4415
|
-
constructor(args: any);
|
|
4416
|
-
private toastNumber;
|
|
4417
|
-
private toastMaps;
|
|
4418
|
-
beforePlayerInit(): void;
|
|
4419
|
-
afterPlayerInit(): void;
|
|
4420
|
-
afterCreate(): void;
|
|
4421
|
-
destroy(): void;
|
|
4422
|
-
add(content: string | HTMLElement, duration?: number, isNeedCloseBt?: boolean): number;
|
|
4423
|
-
remove(id: number): void;
|
|
4424
|
-
renderToast(content: string | HTMLElement, isNeedCloseBt: any, id: any): HTMLElement;
|
|
4425
|
-
render(): string;
|
|
4426
|
-
}
|
|
4427
|
-
export declare class MemoryPlay extends Plugin {
|
|
4428
|
-
static get pluginName(): string;
|
|
4429
|
-
static get defaultConfig(): {
|
|
4430
|
-
getTime: any;
|
|
4431
|
-
saveTime: any;
|
|
4432
|
-
memoryId: string;
|
|
4433
|
-
};
|
|
4434
|
-
startTime: number;
|
|
4435
|
-
saveTimeFun: (id: number | string, time: number) => unknown;
|
|
4436
|
-
getTimeFun: (id: number | string) => number | Promise<number>;
|
|
4437
|
-
memoryId: number | string;
|
|
4438
|
-
canJump: boolean;
|
|
4439
|
-
constructor(args: any);
|
|
4440
|
-
registerLanguageTexts(): {
|
|
4441
|
-
preText: {
|
|
4442
|
-
jp: string;
|
|
4443
|
-
en: string;
|
|
4444
|
-
zh: string;
|
|
4445
|
-
"zh-hk": string;
|
|
4446
|
-
};
|
|
4447
|
-
};
|
|
4448
|
-
children(): {
|
|
4449
|
-
toast: typeof ToastPlugin;
|
|
4450
|
-
};
|
|
4451
|
-
afterCreate(): void;
|
|
4452
|
-
beforePlayerInit(): Promise<void>;
|
|
4453
|
-
destroy(): void;
|
|
4454
|
-
getTime(): Promise<void>;
|
|
4455
|
-
setSave(): void;
|
|
4456
|
-
showToast(): void;
|
|
4457
|
-
saveTimeByStorage(memoryId: any, time: any): void;
|
|
4458
|
-
getTimeByStorage(memoryId: any): string;
|
|
4459
|
-
}
|
|
4460
4457
|
export declare type InfoItem = {
|
|
4461
4458
|
key: string;
|
|
4462
4459
|
label: string;
|