@byteplus/veplayer 1.19.0-rc.5 → 1.19.0-rc.6
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 +1412 -538
- package/index.min.css +1 -1
- package/index.min.js +2 -2
- package/lite.cjs +2 -2
- package/lite.cjs.css +1 -1
- package/lite.d.ts +915 -2
- package/lite.esm.css +1 -1
- package/lite.esm.mjs +2 -2
- package/lite.min.css +1 -1
- package/lite.min.js +2 -2
- package/package.json +1 -1
- package/plugin/hlsEncrypt.js +2 -2
- package/plugin/hlsjs.js +1 -1
- package/plugin/hlsjsPro.js +2 -2
- package/plugin/modules/DashAbralgo.mjs +1 -1
- package/plugin/modules/XGVideo.mjs +1 -1
- package/plugin/modules/danmuMask.mjs +1 -1
- package/plugin/modules/danmujs.mjs +1 -1
- package/plugin/modules/dash.mjs +1 -1
- package/plugin/modules/flv.mjs +1 -1
- package/plugin/modules/hls.mjs +1 -1
- package/plugin/modules/hlsEncrypt.mjs +2 -2
- package/plugin/modules/hlsjs.mjs +2 -2
- package/plugin/modules/hlsjsPro.mjs +2 -2
- package/plugin/modules/mp4Encrypt.mjs +1 -1
- package/plugin/modules/preloader.mjs +1 -1
- package/plugin/modules/streamprobe.mjs +1 -1
- package/plugin/modules/vestrategy.mjs +1 -1
- package/plugin/modules/vestrategy_adapt_range.mjs +1 -1
- package/plugin/modules/vestrategy_h265.mjs +1 -1
- package/plugin/modules/vestrategy_preload.mjs +1 -1
- package/plugin/xgHls.js +1 -1
package/index.d.ts
CHANGED
|
@@ -546,6 +546,45 @@ export interface ISubtitleConfig {
|
|
|
546
546
|
* @default -
|
|
547
547
|
*/
|
|
548
548
|
list?: Array<ISubTitleItem>;
|
|
549
|
+
/** {zh}
|
|
550
|
+
* @brief 字幕选择项的多语言映射与自定义格式化配置。
|
|
551
|
+
* @notes 同时作用于业务配置字幕、Vid/PlayAuth 或短剧自动字幕,以及 Master M3U8 字幕。仅改变 VePlayer 字幕菜单文案,不改变字幕 ID、切换和渲染行为。iOS 系统字幕菜单不受此配置影响。
|
|
552
|
+
* @default -
|
|
553
|
+
* @example
|
|
554
|
+
* ``` javascript
|
|
555
|
+
* Subtitle: {
|
|
556
|
+
* label: {
|
|
557
|
+
* map: {
|
|
558
|
+
* language: {
|
|
559
|
+
* en: { textKey: 'SUBTITLE_EN', text: 'English' }
|
|
560
|
+
* }
|
|
561
|
+
* },
|
|
562
|
+
* formatter: ({ defaultLabel, item }) =>
|
|
563
|
+
* item.forced ? `${defaultLabel} · Forced` : defaultLabel
|
|
564
|
+
* }
|
|
565
|
+
* }
|
|
566
|
+
* ```
|
|
567
|
+
*/
|
|
568
|
+
/** {en}
|
|
569
|
+
* @brief Localization mapping and custom formatter for subtitle option labels.
|
|
570
|
+
* @notes Applies to business-configured subtitles, Vid/PlayAuth or short-drama automatic subtitles, and Master M3U8 subtitles. It only changes labels in VePlayer subtitle menus; subtitle IDs, switching, and rendering are unchanged. The iOS system subtitle menu is not affected.
|
|
571
|
+
* @default -
|
|
572
|
+
* @example
|
|
573
|
+
* ``` javascript
|
|
574
|
+
* Subtitle: {
|
|
575
|
+
* label: {
|
|
576
|
+
* map: {
|
|
577
|
+
* language: {
|
|
578
|
+
* en: { textKey: 'SUBTITLE_EN', text: 'English' }
|
|
579
|
+
* }
|
|
580
|
+
* },
|
|
581
|
+
* formatter: ({ defaultLabel, item }) =>
|
|
582
|
+
* item.forced ? `${defaultLabel} · Forced` : defaultLabel
|
|
583
|
+
* }
|
|
584
|
+
* }
|
|
585
|
+
* ```
|
|
586
|
+
*/
|
|
587
|
+
label?: ISubtitleLabelOptions;
|
|
549
588
|
/** {zh}
|
|
550
589
|
* @brief 是否默认打开字幕。
|
|
551
590
|
* @default true
|
|
@@ -577,6 +616,19 @@ export interface ISubtitleConfig {
|
|
|
577
616
|
* @default external
|
|
578
617
|
*/
|
|
579
618
|
mode?: "external" | "native";
|
|
619
|
+
/** {zh}
|
|
620
|
+
* @brief 原生字幕渲染方式。仅当 `mode` 为 `native` 且使用 iOS 原生 HLS 时生效:
|
|
621
|
+
* - `"system"`:由系统渲染字幕。
|
|
622
|
+
* - `"dom"`:内联播放时由 VePlayer 使用 DOM 渲染;原生全屏、画中画或远程播放时自动回退到系统渲染。
|
|
623
|
+
* @default system
|
|
624
|
+
*/
|
|
625
|
+
/** {en}
|
|
626
|
+
* @brief Native subtitle rendering mode. It only applies to iOS native HLS when `mode` is `native`:
|
|
627
|
+
* - `"system"`: render subtitles with the system UI.
|
|
628
|
+
* - `"dom"`: render subtitles in the VePlayer DOM during inline playback and fall back to system rendering in native fullscreen, picture-in-picture, or remote playback.
|
|
629
|
+
* @default system
|
|
630
|
+
*/
|
|
631
|
+
nativeRenderMode?: "system" | "dom";
|
|
580
632
|
/**
|
|
581
633
|
* @brief 字幕更新模式,默认vod
|
|
582
634
|
* @default vod
|
|
@@ -769,6 +821,15 @@ export interface ISubtitleStyle {
|
|
|
769
821
|
* @kind property
|
|
770
822
|
*/
|
|
771
823
|
export interface ISubTitleItem {
|
|
824
|
+
/** {zh}
|
|
825
|
+
* @brief 字幕来源。业务配置字幕为 `config`,Master M3U8 或原生 HLS 字幕为 `hls`。
|
|
826
|
+
* @default config
|
|
827
|
+
*/
|
|
828
|
+
/** {en}
|
|
829
|
+
* @brief Subtitle source. Business-configured subtitles use `config`; Master M3U8 or native HLS subtitles use `hls`.
|
|
830
|
+
* @default config
|
|
831
|
+
*/
|
|
832
|
+
source?: "config" | "hls";
|
|
772
833
|
/** {zh}
|
|
773
834
|
* @brief 字幕语言。
|
|
774
835
|
* @default -
|
|
@@ -796,6 +857,24 @@ export interface ISubTitleItem {
|
|
|
796
857
|
* @default false
|
|
797
858
|
*/
|
|
798
859
|
isDefault?: boolean;
|
|
860
|
+
/** {zh}
|
|
861
|
+
* @brief 是否为强制字幕轨。
|
|
862
|
+
* @default false
|
|
863
|
+
*/
|
|
864
|
+
/** {en}
|
|
865
|
+
* @brief Whether the subtitle track is forced.
|
|
866
|
+
* @default false
|
|
867
|
+
*/
|
|
868
|
+
forced?: boolean;
|
|
869
|
+
/** {zh}
|
|
870
|
+
* @brief HLS 字幕轨的特征标识,例如无障碍字幕特征;未声明时为空。
|
|
871
|
+
* @default -
|
|
872
|
+
*/
|
|
873
|
+
/** {en}
|
|
874
|
+
* @brief HLS subtitle-track characteristics, such as accessibility traits; absent when not declared.
|
|
875
|
+
* @default -
|
|
876
|
+
*/
|
|
877
|
+
characteristics?: string;
|
|
799
878
|
/** {zh}
|
|
800
879
|
* @brief 字幕名称。
|
|
801
880
|
* @default -
|
|
@@ -804,7 +883,7 @@ export interface ISubTitleItem {
|
|
|
804
883
|
* @brief Subtitle display name.
|
|
805
884
|
* @default -
|
|
806
885
|
*/
|
|
807
|
-
text?:
|
|
886
|
+
text?: ISubtitleLabelValue;
|
|
808
887
|
/** {zh}
|
|
809
888
|
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
810
889
|
* @default -
|
|
@@ -813,7 +892,7 @@ export interface ISubTitleItem {
|
|
|
813
892
|
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
814
893
|
* @default -
|
|
815
894
|
*/
|
|
816
|
-
label?:
|
|
895
|
+
label?: ISubtitleLabelValue;
|
|
817
896
|
/** {zh}
|
|
818
897
|
* @brief 外挂字幕 URL 地址。
|
|
819
898
|
* @default -
|
|
@@ -843,6 +922,118 @@ export interface ISubTitleItem {
|
|
|
843
922
|
*/
|
|
844
923
|
list?: IListItem[];
|
|
845
924
|
}
|
|
925
|
+
/** {zh}
|
|
926
|
+
* @brief 字幕项名称,可为静态文案或按播放器语言配置的文案表。
|
|
927
|
+
* @detail ref
|
|
928
|
+
*/
|
|
929
|
+
/** {en}
|
|
930
|
+
* @brief Subtitle item name as static text or a text map keyed by player language.
|
|
931
|
+
* @detail ref
|
|
932
|
+
*/
|
|
933
|
+
export declare type ISubtitleLabelValue = string | number | Record<string, string | number>;
|
|
934
|
+
/** {zh}
|
|
935
|
+
* @brief 字幕标签映射项。
|
|
936
|
+
* @detail ref
|
|
937
|
+
*/
|
|
938
|
+
/** {en}
|
|
939
|
+
* @brief Mapping item used to customize a subtitle label.
|
|
940
|
+
* @detail ref
|
|
941
|
+
*/
|
|
942
|
+
export interface ISubtitleLabelItem {
|
|
943
|
+
/** {zh} @brief 多语言 key 无法解析时使用的回退文案。 */
|
|
944
|
+
/** {en} @brief Fallback text used when the i18n key cannot be resolved. */
|
|
945
|
+
text?: string;
|
|
946
|
+
/** {zh} @brief 从播放器当前多语言词典中读取文案的 key。 */
|
|
947
|
+
/** {en} @brief Key resolved from the player's active i18n dictionary. */
|
|
948
|
+
textKey?: string;
|
|
949
|
+
}
|
|
950
|
+
/** {zh}
|
|
951
|
+
* @brief 字幕标签映射表。匹配优先级为 `id`、完整 `language`、基础 `language`、原始 `text`。
|
|
952
|
+
* @detail ref
|
|
953
|
+
*/
|
|
954
|
+
/** {en}
|
|
955
|
+
* @brief Subtitle label maps. Match order is `id`, full `language`, base `language`, then source `text`.
|
|
956
|
+
* @detail ref
|
|
957
|
+
*/
|
|
958
|
+
export interface ISubtitleLabelMap {
|
|
959
|
+
/** {zh} @brief 按稳定字幕 ID 映射;不建议用于会话内生成 ID 的 Master M3U8 字幕。 */
|
|
960
|
+
/** {en} @brief Maps stable subtitle IDs; not recommended for session-scoped Master M3U8 IDs. */
|
|
961
|
+
id?: Record<string, ISubtitleLabelItem>;
|
|
962
|
+
/** {zh} @brief 按字幕语言映射,忽略大小写并兼容 `_` 与 `-`。 */
|
|
963
|
+
/** {en} @brief Maps subtitle languages case-insensitively, treating `_` and `-` as equivalent. */
|
|
964
|
+
language?: Record<string, ISubtitleLabelItem>;
|
|
965
|
+
/** {zh} @brief 按字幕原始名称映射。 */
|
|
966
|
+
/** {en} @brief Maps the source subtitle name. */
|
|
967
|
+
text?: Record<string, ISubtitleLabelItem>;
|
|
968
|
+
}
|
|
969
|
+
/** {zh}
|
|
970
|
+
* @brief 传给字幕标签 formatter 的只读安全字幕快照,不包含 URL 或字幕内容。
|
|
971
|
+
* @detail ref
|
|
972
|
+
*/
|
|
973
|
+
/** {en}
|
|
974
|
+
* @brief Read-only safe subtitle snapshot passed to the label formatter, excluding URLs and subtitle content.
|
|
975
|
+
* @detail ref
|
|
976
|
+
*/
|
|
977
|
+
export interface ISubtitleLabelTrack {
|
|
978
|
+
source?: "config" | "hls";
|
|
979
|
+
id?: string | number;
|
|
980
|
+
language?: string | number;
|
|
981
|
+
isDefault?: boolean;
|
|
982
|
+
forced?: boolean;
|
|
983
|
+
characteristics?: string;
|
|
984
|
+
text?: string | number;
|
|
985
|
+
label?: string | number;
|
|
986
|
+
}
|
|
987
|
+
/** {zh}
|
|
988
|
+
* @brief 字幕标签格式化上下文。
|
|
989
|
+
* @detail ref
|
|
990
|
+
*/
|
|
991
|
+
/** {en}
|
|
992
|
+
* @brief Context passed to the subtitle label formatter.
|
|
993
|
+
* @detail ref
|
|
994
|
+
*/
|
|
995
|
+
export interface ISubtitleLabelContext {
|
|
996
|
+
/** {zh} @brief 当前字幕项的只读安全快照。 */
|
|
997
|
+
/** {en} @brief Read-only safe snapshot of the current subtitle item. */
|
|
998
|
+
item: Readonly<ISubtitleLabelTrack>;
|
|
999
|
+
/** {zh} @brief 当前字幕列表的只读安全快照。 */
|
|
1000
|
+
/** {en} @brief Read-only safe snapshots of the current subtitle list. */
|
|
1001
|
+
items: ReadonlyArray<Readonly<ISubtitleLabelTrack>>;
|
|
1002
|
+
/** {zh} @brief 当前字幕项在列表中的位置。 */
|
|
1003
|
+
/** {en} @brief Position of the current subtitle item in the list. */
|
|
1004
|
+
index: number;
|
|
1005
|
+
/** {zh} @brief 应用标签映射前的原始回退文案。 */
|
|
1006
|
+
/** {en} @brief Source fallback text before applying label mappings. */
|
|
1007
|
+
canonicalLabel: string;
|
|
1008
|
+
/** {zh} @brief 应用 `textKey` 或 `text` 后的文案。 */
|
|
1009
|
+
/** {en} @brief Label after applying `textKey` or `text`. */
|
|
1010
|
+
localizedLabel: string;
|
|
1011
|
+
/** {zh} @brief formatter 返回空值或抛出异常时使用的文案。 */
|
|
1012
|
+
/** {en} @brief Label used when the formatter returns an empty value or throws. */
|
|
1013
|
+
defaultLabel: string;
|
|
1014
|
+
/** {zh} @brief 播放器当前语言。 */
|
|
1015
|
+
/** {en} @brief Current player language. */
|
|
1016
|
+
lang: string;
|
|
1017
|
+
/** {zh} @brief 本地化后的文案是否在当前字幕列表中重复。 */
|
|
1018
|
+
/** {en} @brief Whether the localized label is duplicated in the current subtitle list. */
|
|
1019
|
+
duplicated: boolean;
|
|
1020
|
+
}
|
|
1021
|
+
/** {zh}
|
|
1022
|
+
* @brief 字幕标签多语言映射与自定义格式化配置。
|
|
1023
|
+
* @detail ref
|
|
1024
|
+
*/
|
|
1025
|
+
/** {en}
|
|
1026
|
+
* @brief Localization mapping and custom formatter for subtitle labels.
|
|
1027
|
+
* @detail ref
|
|
1028
|
+
*/
|
|
1029
|
+
export interface ISubtitleLabelOptions {
|
|
1030
|
+
/** {zh} @brief 按字幕 ID、语言或原始名称配置展示文案。 */
|
|
1031
|
+
/** {en} @brief Display-label mappings keyed by subtitle ID, language, or source name. */
|
|
1032
|
+
map?: ISubtitleLabelMap;
|
|
1033
|
+
/** {zh} @brief 同步格式化最终标签;返回空值、Promise 或抛出异常时回退到 `defaultLabel`。 */
|
|
1034
|
+
/** {en} @brief Synchronously formats the final label; empty values, Promises, or exceptions fall back to `defaultLabel`. */
|
|
1035
|
+
formatter?: (context: ISubtitleLabelContext) => string | null | undefined;
|
|
1036
|
+
}
|
|
846
1037
|
export declare type IAutoSubtitleSourceItem = Record<string, any> | string;
|
|
847
1038
|
export declare type IAutoSubtitleFormatterResult = string | number | boolean | null | undefined | {
|
|
848
1039
|
label?: string | number;
|
|
@@ -3428,6 +3619,465 @@ export interface IVideoInfo {
|
|
|
3428
3619
|
Data: IGetPlayInfoRes;
|
|
3429
3620
|
};
|
|
3430
3621
|
}
|
|
3622
|
+
/** {zh}
|
|
3623
|
+
* @brief VePlayer 实际使用的 HLS 播放内核。
|
|
3624
|
+
* @detail ref
|
|
3625
|
+
*/
|
|
3626
|
+
/** {en}
|
|
3627
|
+
* @brief The HLS playback engine actually used by VePlayer.
|
|
3628
|
+
* @detail ref
|
|
3629
|
+
*/
|
|
3630
|
+
export declare type HlsPlaybackEngine = "hlsjs" | "veplayer-hls" | "native" | "none";
|
|
3631
|
+
/** {zh}
|
|
3632
|
+
* @brief HLS 自动码率决策引擎配置值。
|
|
3633
|
+
* @detail ref
|
|
3634
|
+
*/
|
|
3635
|
+
/** {en}
|
|
3636
|
+
* @brief Configurable HLS adaptive-bitrate decision engine.
|
|
3637
|
+
* @detail ref
|
|
3638
|
+
*/
|
|
3639
|
+
export declare type HlsAbrEngine = "hlsjs" | "veplayer";
|
|
3640
|
+
/** {zh}
|
|
3641
|
+
* @brief 当前播放会话最终解析出的自动码率决策引擎。
|
|
3642
|
+
* @detail ref
|
|
3643
|
+
*/
|
|
3644
|
+
/** {en}
|
|
3645
|
+
* @brief Adaptive-bitrate decision engine resolved for the current playback session.
|
|
3646
|
+
* @detail ref
|
|
3647
|
+
*/
|
|
3648
|
+
export declare type ResolvedAbrEngine = HlsAbrEngine | "native" | "none";
|
|
3649
|
+
/** {zh}
|
|
3650
|
+
* @brief HLS 自动码率控制模式。
|
|
3651
|
+
* @detail ref
|
|
3652
|
+
*/
|
|
3653
|
+
/** {en}
|
|
3654
|
+
* @brief HLS adaptive-bitrate control mode.
|
|
3655
|
+
* @detail ref
|
|
3656
|
+
*/
|
|
3657
|
+
export declare type HlsAbrMode = "auto" | "manual";
|
|
3658
|
+
/** {zh}
|
|
3659
|
+
* @brief 当前播放会话无法使用 HLS ABR 的原因。
|
|
3660
|
+
* @detail ref
|
|
3661
|
+
*/
|
|
3662
|
+
/** {en}
|
|
3663
|
+
* @brief Reason why HLS ABR is unavailable for the current playback session.
|
|
3664
|
+
* @detail ref
|
|
3665
|
+
*/
|
|
3666
|
+
export declare type HlsAbrUnavailableReason = "NOT_HLS" | "NOT_HLSJS_ENGINE" | "MANIFEST_NOT_READY" | "MULTI_LEVEL_MASTER_REQUIRED" | "DEFINITION_LIST_REQUIRED" | "ABR_MODULE_UNAVAILABLE" | "ABR_RUNTIME_UNAVAILABLE" | "LICENSE_UNAVAILABLE" | "NO_ABR_VARIANTS";
|
|
3667
|
+
/** {zh}
|
|
3668
|
+
* @brief 当前 HLS 播放会话支持的 ABR 能力。
|
|
3669
|
+
* @detail ref
|
|
3670
|
+
*/
|
|
3671
|
+
/** {en}
|
|
3672
|
+
* @brief ABR capabilities supported by the current HLS playback session.
|
|
3673
|
+
* @detail ref
|
|
3674
|
+
*/
|
|
3675
|
+
export interface IHlsAbrCapabilities {
|
|
3676
|
+
/** {zh} @brief 是否可读取 HLS Level 列表。 */
|
|
3677
|
+
/** {en} @brief Whether the HLS Level list is available. */
|
|
3678
|
+
levelList: boolean;
|
|
3679
|
+
/** {zh} @brief 是否支持手动切换 HLS Level。 */
|
|
3680
|
+
/** {en} @brief Whether manual HLS Level switching is supported. */
|
|
3681
|
+
manualLevelSwitch: boolean;
|
|
3682
|
+
/** {zh} @brief 是否支持恢复当前 ABR 引擎的自动模式。 */
|
|
3683
|
+
/** {en} @brief Whether automatic mode can be restored for the resolved ABR engine. */
|
|
3684
|
+
restoreAuto: boolean;
|
|
3685
|
+
/** {zh} @brief 是否支持按 Level 设置自动码率上限。 */
|
|
3686
|
+
/** {en} @brief Whether an automatic bitrate cap can be set by Level. */
|
|
3687
|
+
levelCap: boolean;
|
|
3688
|
+
/** {zh} @brief 是否支持按码率设置自动码率上限。 */
|
|
3689
|
+
/** {en} @brief Whether an automatic bitrate cap can be set by bitrate. */
|
|
3690
|
+
bitrateCap: boolean;
|
|
3691
|
+
/** {zh} @brief 是否支持按 VePlayer 清晰度设置自动码率上限。 */
|
|
3692
|
+
/** {en} @brief Whether an automatic bitrate cap can be set by VePlayer definition. */
|
|
3693
|
+
definitionCap: boolean;
|
|
3694
|
+
}
|
|
3695
|
+
/** {zh}
|
|
3696
|
+
* @brief 当前播放会话的 HLS ABR 状态快照。
|
|
3697
|
+
* @detail ref
|
|
3698
|
+
*/
|
|
3699
|
+
/** {en}
|
|
3700
|
+
* @brief HLS ABR state snapshot for the current playback session.
|
|
3701
|
+
* @detail ref
|
|
3702
|
+
*/
|
|
3703
|
+
export interface IHlsAbrState {
|
|
3704
|
+
/** {zh} @brief 播放会话 ID,用于识别过期状态和事件。 */
|
|
3705
|
+
/** {en} @brief Playback session ID used to reject stale state and events. */
|
|
3706
|
+
playbackSessionId: string;
|
|
3707
|
+
/** {zh} @brief VePlayer 实际使用的 HLS 播放内核。 */
|
|
3708
|
+
/** {en} @brief HLS playback engine actually used by VePlayer. */
|
|
3709
|
+
playbackEngine: HlsPlaybackEngine;
|
|
3710
|
+
/** {zh} @brief 业务显式配置的 ABR 引擎;未配置时为 `null`。 */
|
|
3711
|
+
/** {en} @brief Explicitly configured ABR engine, or `null` when omitted. */
|
|
3712
|
+
configuredEngine: HlsAbrEngine | null;
|
|
3713
|
+
/** {zh} @brief 当前播放会话最终解析出的 ABR 决策引擎。 */
|
|
3714
|
+
/** {en} @brief ABR decision engine resolved for the current playback session. */
|
|
3715
|
+
engine: ResolvedAbrEngine;
|
|
3716
|
+
/** {zh} @brief 当前清晰度决策使用的数据源。 */
|
|
3717
|
+
/** {en} @brief Data source used for the current rendition decision. */
|
|
3718
|
+
decisionSource: "hls-levels" | "definition-list" | "native" | "none";
|
|
3719
|
+
/** {zh} @brief 当前播放会话是否具备所选 ABR 引擎所需条件。 */
|
|
3720
|
+
/** {en} @brief Whether the selected ABR engine is available in the current session. */
|
|
3721
|
+
available: boolean;
|
|
3722
|
+
/** {zh} @brief 当前 ABR 决策引擎是否正在自动选档。 */
|
|
3723
|
+
/** {en} @brief Whether the resolved ABR engine is actively selecting renditions. */
|
|
3724
|
+
active: boolean;
|
|
3725
|
+
/** {zh} @brief 当前为自动模式还是手动模式。 */
|
|
3726
|
+
/** {en} @brief Whether the current mode is automatic or manual. */
|
|
3727
|
+
mode: HlsAbrMode;
|
|
3728
|
+
/** {zh} @brief hls.js 当前实际播放的 Level 索引。 */
|
|
3729
|
+
/** {en} @brief Current hls.js Level index being rendered. */
|
|
3730
|
+
currentLevel?: number;
|
|
3731
|
+
/** {zh} @brief VePlayer ABR 当前实际播放的清晰度。 */
|
|
3732
|
+
/** {en} @brief Current definition rendered by VePlayer ABR. */
|
|
3733
|
+
currentDefinition?: string;
|
|
3734
|
+
/** {zh} @brief ABR 不可用时的稳定原因码。 */
|
|
3735
|
+
/** {en} @brief Stable reason code when ABR is unavailable. */
|
|
3736
|
+
reason?: HlsAbrUnavailableReason;
|
|
3737
|
+
/** {zh} @brief 当前播放会话支持的 ABR 控制能力。 */
|
|
3738
|
+
/** {en} @brief ABR control capabilities supported by the current session. */
|
|
3739
|
+
capabilities: IHlsAbrCapabilities;
|
|
3740
|
+
}
|
|
3741
|
+
/** {zh}
|
|
3742
|
+
* @brief HLS ABR 上限;`null` 表示清除上限。
|
|
3743
|
+
* @detail ref
|
|
3744
|
+
*/
|
|
3745
|
+
/** {en}
|
|
3746
|
+
* @brief HLS ABR limit; `null` clears the active limit.
|
|
3747
|
+
* @detail ref
|
|
3748
|
+
*/
|
|
3749
|
+
export declare type IHlsAbrLimit = {
|
|
3750
|
+
type: "level";
|
|
3751
|
+
maxLevel: number;
|
|
3752
|
+
} | {
|
|
3753
|
+
type: "bitrate";
|
|
3754
|
+
maxBitrate: number;
|
|
3755
|
+
} | {
|
|
3756
|
+
type: "definition";
|
|
3757
|
+
maxDefinition: string;
|
|
3758
|
+
} | null;
|
|
3759
|
+
/** {zh}
|
|
3760
|
+
* @brief `HLS_ABR_ENGINE_RESOLVED` 事件数据。
|
|
3761
|
+
* @detail ref
|
|
3762
|
+
*/
|
|
3763
|
+
/** {en}
|
|
3764
|
+
* @brief Payload of the `HLS_ABR_ENGINE_RESOLVED` event.
|
|
3765
|
+
* @detail ref
|
|
3766
|
+
*/
|
|
3767
|
+
export interface IHlsAbrEngineResolvedEvent extends IHlsAbrState {
|
|
3768
|
+
}
|
|
3769
|
+
/** {zh}
|
|
3770
|
+
* @brief `HLS_ABR_STATE_CHANGE` 事件数据。
|
|
3771
|
+
* @detail ref
|
|
3772
|
+
*/
|
|
3773
|
+
/** {en}
|
|
3774
|
+
* @brief Payload of the `HLS_ABR_STATE_CHANGE` event.
|
|
3775
|
+
* @detail ref
|
|
3776
|
+
*/
|
|
3777
|
+
export interface IHlsAbrStateChangeEvent extends IHlsAbrState {
|
|
3778
|
+
}
|
|
3779
|
+
/** {zh}
|
|
3780
|
+
* @brief `HLS_ABR_LIMIT_CHANGE` 事件数据。
|
|
3781
|
+
* @detail ref
|
|
3782
|
+
*/
|
|
3783
|
+
/** {en}
|
|
3784
|
+
* @brief Payload of the `HLS_ABR_LIMIT_CHANGE` event.
|
|
3785
|
+
* @detail ref
|
|
3786
|
+
*/
|
|
3787
|
+
export interface IHlsAbrLimitChangeEvent {
|
|
3788
|
+
/** {zh} @brief 事件所属的播放会话 ID。 */
|
|
3789
|
+
/** {en} @brief Playback session ID that owns the event. */
|
|
3790
|
+
playbackSessionId: string;
|
|
3791
|
+
/** {zh} @brief 当前播放会话最终解析出的 ABR 决策引擎。 */
|
|
3792
|
+
/** {en} @brief ABR decision engine resolved for the current playback session. */
|
|
3793
|
+
engine: ResolvedAbrEngine;
|
|
3794
|
+
/** {zh} @brief 已生效的 ABR 上限;`null` 表示上限已清除。 */
|
|
3795
|
+
/** {en} @brief Applied ABR limit, or `null` when the limit has been cleared. */
|
|
3796
|
+
limit: IHlsAbrLimit;
|
|
3797
|
+
}
|
|
3798
|
+
/** {zh}
|
|
3799
|
+
* @brief Master M3U8 中一个标准化的 HLS Level;`index` 仅在当前播放会话内有效。
|
|
3800
|
+
* @detail ref
|
|
3801
|
+
*/
|
|
3802
|
+
/** {en}
|
|
3803
|
+
* @brief A normalized HLS Level from a Master M3U8; `index` is valid only in the current playback session.
|
|
3804
|
+
* @detail ref
|
|
3805
|
+
*/
|
|
3806
|
+
export interface IHlsLevel {
|
|
3807
|
+
/** {zh} @brief 当前播放会话内的 Level 索引。 */
|
|
3808
|
+
/** {en} @brief Level index within the current playback session. */
|
|
3809
|
+
index: number;
|
|
3810
|
+
/** {zh} @brief 峰值码率,单位为 bit/s。 */
|
|
3811
|
+
/** {en} @brief Peak bitrate in bits per second. */
|
|
3812
|
+
bitrate: number;
|
|
3813
|
+
/** {zh} @brief 平均码率,单位为 bit/s。 */
|
|
3814
|
+
/** {en} @brief Average bitrate in bits per second. */
|
|
3815
|
+
averageBitrate?: number;
|
|
3816
|
+
/** {zh} @brief 视频宽度,单位为像素。 */
|
|
3817
|
+
/** {en} @brief Video width in pixels. */
|
|
3818
|
+
width?: number;
|
|
3819
|
+
/** {zh} @brief 视频高度,单位为像素。 */
|
|
3820
|
+
/** {en} @brief Video height in pixels. */
|
|
3821
|
+
height?: number;
|
|
3822
|
+
/** {zh} @brief 视频帧率。 */
|
|
3823
|
+
/** {en} @brief Video frame rate. */
|
|
3824
|
+
frameRate?: number;
|
|
3825
|
+
/** {zh} @brief 视频编码标识。 */
|
|
3826
|
+
/** {en} @brief Video codec identifier. */
|
|
3827
|
+
videoCodec?: string;
|
|
3828
|
+
/** {zh} @brief 音频编码标识。 */
|
|
3829
|
+
/** {en} @brief Audio codec identifier. */
|
|
3830
|
+
audioCodec?: string;
|
|
3831
|
+
/** {zh} @brief 视频动态范围标识。 */
|
|
3832
|
+
/** {en} @brief Video dynamic-range identifier. */
|
|
3833
|
+
videoRange?: string;
|
|
3834
|
+
/** {zh} @brief Manifest 声明的 Level 名称。 */
|
|
3835
|
+
/** {en} @brief Level name declared by the manifest. */
|
|
3836
|
+
name?: string;
|
|
3837
|
+
}
|
|
3838
|
+
/** {zh}
|
|
3839
|
+
* @brief HLS Level 标签映射项。
|
|
3840
|
+
* @detail ref
|
|
3841
|
+
*/
|
|
3842
|
+
/** {en}
|
|
3843
|
+
* @brief Mapping item used to customize an HLS Level label.
|
|
3844
|
+
* @detail ref
|
|
3845
|
+
*/
|
|
3846
|
+
export interface IHlsLevelLabelItem {
|
|
3847
|
+
/** {zh} @brief 当多语言 key 无法解析时使用的回退文案。 */
|
|
3848
|
+
/** {en} @brief Fallback text used when the i18n key cannot be resolved. */
|
|
3849
|
+
text?: string;
|
|
3850
|
+
/** {zh} @brief 从播放器当前多语言词典中读取文案的 key。 */
|
|
3851
|
+
/** {en} @brief Key resolved from the player's active i18n dictionary. */
|
|
3852
|
+
textKey?: string;
|
|
3853
|
+
}
|
|
3854
|
+
/** {zh}
|
|
3855
|
+
* @brief HLS Level 标签格式化上下文。
|
|
3856
|
+
* @detail ref
|
|
3857
|
+
*/
|
|
3858
|
+
/** {en}
|
|
3859
|
+
* @brief Context passed to the HLS Level label formatter.
|
|
3860
|
+
* @detail ref
|
|
3861
|
+
*/
|
|
3862
|
+
export interface IHlsLevelLabelContext {
|
|
3863
|
+
/** {zh} @brief 当前 Level 的只读安全快照。 */
|
|
3864
|
+
/** {en} @brief Read-only safe snapshot of the current Level. */
|
|
3865
|
+
level: Readonly<IHlsLevel>;
|
|
3866
|
+
/** {zh} @brief 当前播放会话全部 Level 的只读安全快照。 */
|
|
3867
|
+
/** {en} @brief Read-only safe snapshots of all Levels in the current playback session. */
|
|
3868
|
+
levels: ReadonlyArray<Readonly<IHlsLevel>>;
|
|
3869
|
+
/** {zh} @brief 视频短边像素值;Manifest 未提供分辨率时为空。 */
|
|
3870
|
+
/** {en} @brief Video short edge in pixels, or undefined when dimensions are unavailable. */
|
|
3871
|
+
shortEdge?: number;
|
|
3872
|
+
/** {zh} @brief 未本地化、未消歧的标准标签。 */
|
|
3873
|
+
/** {en} @brief Canonical label before localization and disambiguation. */
|
|
3874
|
+
canonicalLabel: string;
|
|
3875
|
+
/** {zh} @brief 应用 `textKey` 或 `text` 后的基础标签。 */
|
|
3876
|
+
/** {en} @brief Base label after applying `textKey` or `text`. */
|
|
3877
|
+
localizedLabel: string;
|
|
3878
|
+
/** {zh} @brief 完成 SDK 默认重名消歧后的标签。 */
|
|
3879
|
+
/** {en} @brief Label after the SDK's default duplicate disambiguation. */
|
|
3880
|
+
defaultLabel: string;
|
|
3881
|
+
/** {zh} @brief 播放器当前语言。 */
|
|
3882
|
+
/** {en} @brief Current player language. */
|
|
3883
|
+
lang: string;
|
|
3884
|
+
/** {zh} @brief 当前标准标签是否在 Level 列表中重复。 */
|
|
3885
|
+
/** {en} @brief Whether the canonical label is duplicated in the Level list. */
|
|
3886
|
+
duplicated: boolean;
|
|
3887
|
+
}
|
|
3888
|
+
/** {zh}
|
|
3889
|
+
* @brief HLS Level 标签的多语言映射与自定义格式化配置。
|
|
3890
|
+
* @detail ref
|
|
3891
|
+
* @example
|
|
3892
|
+
* ``` javascript
|
|
3893
|
+
* hlsLevelLabel: {
|
|
3894
|
+
* map: {
|
|
3895
|
+
* '720p': { textKey: 'HLS_LEVEL_HD', text: '720p' }
|
|
3896
|
+
* },
|
|
3897
|
+
* formatter: ({ defaultLabel, level }) =>
|
|
3898
|
+
* level.videoRange === 'PQ' ? `${defaultLabel} HDR` : defaultLabel
|
|
3899
|
+
* }
|
|
3900
|
+
* ```
|
|
3901
|
+
*/
|
|
3902
|
+
/** {en}
|
|
3903
|
+
* @brief Localization mapping and custom formatter for HLS Level labels.
|
|
3904
|
+
* @detail ref
|
|
3905
|
+
* @example
|
|
3906
|
+
* ``` javascript
|
|
3907
|
+
* hlsLevelLabel: {
|
|
3908
|
+
* map: {
|
|
3909
|
+
* '720p': { textKey: 'HLS_LEVEL_HD', text: '720p' }
|
|
3910
|
+
* },
|
|
3911
|
+
* formatter: ({ defaultLabel, level }) =>
|
|
3912
|
+
* level.videoRange === 'PQ' ? `${defaultLabel} HDR` : defaultLabel
|
|
3913
|
+
* }
|
|
3914
|
+
* ```
|
|
3915
|
+
*/
|
|
3916
|
+
export interface IHlsLevelLabelOptions {
|
|
3917
|
+
/** {zh} @brief 按标准标签(如 `720p`、`1080p`)配置展示文案。 */
|
|
3918
|
+
/** {en} @brief Display-label mappings keyed by canonical labels such as `720p` and `1080p`. */
|
|
3919
|
+
map?: Record<string, IHlsLevelLabelItem>;
|
|
3920
|
+
/** {zh} @brief 同步格式化最终标签;返回空值或抛出异常时回退到 `defaultLabel`。 */
|
|
3921
|
+
/** {en} @brief Synchronously formats the final label; empty returns or exceptions fall back to `defaultLabel`. */
|
|
3922
|
+
formatter?: (context: IHlsLevelLabelContext) => string | null | undefined;
|
|
3923
|
+
}
|
|
3924
|
+
/** {zh}
|
|
3925
|
+
* @brief 当前播放会话的 HLS Level 状态快照。
|
|
3926
|
+
* @detail ref
|
|
3927
|
+
*/
|
|
3928
|
+
/** {en}
|
|
3929
|
+
* @brief HLS Level state snapshot for the current playback session.
|
|
3930
|
+
* @detail ref
|
|
3931
|
+
*/
|
|
3932
|
+
export interface IHlsLevelState {
|
|
3933
|
+
/** {zh} @brief 播放会话 ID,用于识别过期状态和事件。 */
|
|
3934
|
+
/** {en} @brief Playback session ID used to reject stale state and events. */
|
|
3935
|
+
playbackSessionId: string;
|
|
3936
|
+
/** {zh} @brief Level 列表是否已就绪。 */
|
|
3937
|
+
/** {en} @brief Whether the Level list is ready. */
|
|
3938
|
+
ready: boolean;
|
|
3939
|
+
/** {zh} @brief 当前播放会话内的标准化 Level 列表。 */
|
|
3940
|
+
/** {en} @brief Normalized Level list for the current playback session. */
|
|
3941
|
+
levels: IHlsLevel[];
|
|
3942
|
+
/** {zh} @brief 当前实际播放的 Level 索引,未知时为 `-1`。 */
|
|
3943
|
+
/** {en} @brief Currently rendered Level index, or `-1` when unknown. */
|
|
3944
|
+
currentLevel: number;
|
|
3945
|
+
/** {zh} @brief 当前加载的 Level 索引,未知时为 `-1`。 */
|
|
3946
|
+
/** {en} @brief Currently loaded Level index, or `-1` when unknown. */
|
|
3947
|
+
loadLevel: number;
|
|
3948
|
+
/** {zh} @brief 下一个分片使用的 Level 索引,未知时为 `-1`。 */
|
|
3949
|
+
/** {en} @brief Level index for the next fragment, or `-1` when unknown. */
|
|
3950
|
+
nextLevel: number;
|
|
3951
|
+
/** {zh} @brief 手动 Level 索引;自动模式下为 `-1`。 */
|
|
3952
|
+
/** {en} @brief Manual Level index; `-1` in automatic mode. */
|
|
3953
|
+
manualLevel: number;
|
|
3954
|
+
/** {zh} @brief hls.js 是否处于自动选档模式。 */
|
|
3955
|
+
/** {en} @brief Whether hls.js automatic Level selection is enabled. */
|
|
3956
|
+
autoLevelEnabled: boolean;
|
|
3957
|
+
/** {zh} @brief hls.js 自动选档的 Level 上限;未设置时为 `-1`。 */
|
|
3958
|
+
/** {en} @brief hls.js automatic Level cap; `-1` when unset. */
|
|
3959
|
+
autoLevelCapping: number;
|
|
3960
|
+
}
|
|
3961
|
+
/** {zh}
|
|
3962
|
+
* @brief HLS Level 手动切换模式。
|
|
3963
|
+
* @detail ref
|
|
3964
|
+
*/
|
|
3965
|
+
/** {en}
|
|
3966
|
+
* @brief Manual HLS Level switching mode.
|
|
3967
|
+
* @detail ref
|
|
3968
|
+
*/
|
|
3969
|
+
export declare type HlsLevelSwitchMode = "immediate" | "next-fragment" | "smooth";
|
|
3970
|
+
/** {zh}
|
|
3971
|
+
* @brief 手动切换 HLS Level 的选项。
|
|
3972
|
+
* @detail ref
|
|
3973
|
+
*/
|
|
3974
|
+
/** {en}
|
|
3975
|
+
* @brief Options for manually switching an HLS Level.
|
|
3976
|
+
* @detail ref
|
|
3977
|
+
*/
|
|
3978
|
+
export interface IHlsLevelSwitchOptions {
|
|
3979
|
+
/** {zh} @brief 切换模式,默认为 `next-fragment`。 */
|
|
3980
|
+
/** {en} @brief Switching mode. Defaults to `next-fragment`. */
|
|
3981
|
+
mode?: HlsLevelSwitchMode;
|
|
3982
|
+
/** {zh} @brief 可选的播放会话 ID;不匹配时拒绝本次切换。 */
|
|
3983
|
+
/** {en} @brief Optional playback session ID; a mismatch rejects the switch. */
|
|
3984
|
+
playbackSessionId?: string;
|
|
3985
|
+
}
|
|
3986
|
+
/** {zh}
|
|
3987
|
+
* @brief HLS Level 切换事件数据。
|
|
3988
|
+
* @detail ref
|
|
3989
|
+
*/
|
|
3990
|
+
/** {en}
|
|
3991
|
+
* @brief HLS Level switching event payload.
|
|
3992
|
+
* @detail ref
|
|
3993
|
+
*/
|
|
3994
|
+
export interface IHlsLevelSwitchEvent {
|
|
3995
|
+
/** {zh} @brief 事件所属的播放会话 ID。 */
|
|
3996
|
+
/** {en} @brief Playback session ID that owns the event. */
|
|
3997
|
+
playbackSessionId: string;
|
|
3998
|
+
/** {zh} @brief 切换前的 Level 索引。 */
|
|
3999
|
+
/** {en} @brief Level index before switching. */
|
|
4000
|
+
from: number;
|
|
4001
|
+
/** {zh} @brief 目标或已切换到的 Level 索引。 */
|
|
4002
|
+
/** {en} @brief Target or switched-to Level index. */
|
|
4003
|
+
to: number;
|
|
4004
|
+
/** {zh} @brief 本次切换由手动操作还是 ABR 触发。 */
|
|
4005
|
+
/** {en} @brief Whether the switch was triggered manually or by ABR. */
|
|
4006
|
+
reason: "manual" | "abr";
|
|
4007
|
+
/** {zh} @brief 当前播放会话的 ABR 决策引擎。 */
|
|
4008
|
+
/** {en} @brief ABR decision engine for the current playback session. */
|
|
4009
|
+
abrEngine: ResolvedAbrEngine;
|
|
4010
|
+
/** {zh} @brief 目标或已生效的安全 Level 快照。 */
|
|
4011
|
+
/** {en} @brief Safe snapshot of the target or active Level. */
|
|
4012
|
+
level?: IHlsLevel;
|
|
4013
|
+
}
|
|
4014
|
+
/** {zh}
|
|
4015
|
+
* @brief `HLS_SUBTITLE_TRACKS_UPDATED` 事件数据。
|
|
4016
|
+
* @detail ref
|
|
4017
|
+
*/
|
|
4018
|
+
/** {en}
|
|
4019
|
+
* @brief Payload of the `HLS_SUBTITLE_TRACKS_UPDATED` event.
|
|
4020
|
+
* @detail ref
|
|
4021
|
+
*/
|
|
4022
|
+
export interface IHlsSubtitleTracksUpdatedEvent {
|
|
4023
|
+
/** {zh} @brief 事件所属的播放会话 ID。 */
|
|
4024
|
+
/** {en} @brief Playback session ID that owns the event. */
|
|
4025
|
+
playbackSessionId: string;
|
|
4026
|
+
/** {zh} @brief 当前实际使用的 HLS 播放内核。 */
|
|
4027
|
+
/** {en} @brief HLS playback engine actually used by the session. */
|
|
4028
|
+
playbackEngine: HlsPlaybackEngine;
|
|
4029
|
+
/** {zh} @brief 不含播放地址和底层轨道索引的安全字幕列表。 */
|
|
4030
|
+
/** {en} @brief Safe subtitle list without media URLs or internal track indexes. */
|
|
4031
|
+
tracks: ReadonlyArray<ISubTitleItem>;
|
|
4032
|
+
}
|
|
4033
|
+
/** {zh}
|
|
4034
|
+
* @brief HLS 字幕轨切换事件数据。
|
|
4035
|
+
* @detail ref
|
|
4036
|
+
*/
|
|
4037
|
+
/** {en}
|
|
4038
|
+
* @brief HLS subtitle-track switching event payload.
|
|
4039
|
+
* @detail ref
|
|
4040
|
+
*/
|
|
4041
|
+
export interface IHlsSubtitleTrackSwitchEvent {
|
|
4042
|
+
/** {zh} @brief 事件所属的播放会话 ID。 */
|
|
4043
|
+
/** {en} @brief Playback session ID that owns the event. */
|
|
4044
|
+
playbackSessionId: string;
|
|
4045
|
+
/** {zh} @brief 当前实际使用的 HLS 播放内核。 */
|
|
4046
|
+
/** {en} @brief HLS playback engine actually used by the session. */
|
|
4047
|
+
playbackEngine: HlsPlaybackEngine;
|
|
4048
|
+
/** {zh} @brief 切换前的安全字幕 ID;关闭状态为 `null`。 */
|
|
4049
|
+
/** {en} @brief Safe subtitle ID before switching, or `null` when disabled. */
|
|
4050
|
+
from: string | number | null;
|
|
4051
|
+
/** {zh} @brief 目标或已生效的安全字幕 ID;关闭状态为 `null`。 */
|
|
4052
|
+
/** {en} @brief Target or active safe subtitle ID, or `null` when disabled. */
|
|
4053
|
+
to: string | number | null;
|
|
4054
|
+
/** {zh} @brief 目标或已生效的安全字幕快照。 */
|
|
4055
|
+
/** {en} @brief Safe snapshot of the target or active subtitle track. */
|
|
4056
|
+
track?: ISubTitleItem;
|
|
4057
|
+
}
|
|
4058
|
+
/** {zh}
|
|
4059
|
+
* @brief HLS 控制 API 的标准错误码。
|
|
4060
|
+
* @detail ref
|
|
4061
|
+
*/
|
|
4062
|
+
/** {en}
|
|
4063
|
+
* @brief Standard error codes for HLS control APIs.
|
|
4064
|
+
* @detail ref
|
|
4065
|
+
*/
|
|
4066
|
+
export declare type HlsControlErrorCode = "HLS_MANIFEST_NOT_READY" | "HLS_ENGINE_UNSUPPORTED" | "HLS_LEVEL_OUT_OF_RANGE" | "HLS_PLAYBACK_SESSION_EXPIRED" | "HLS_ABR_UNAVAILABLE" | "HLS_ABR_LIMIT_UNSUPPORTED" | "HLS_SUBTITLE_TRACK_NOT_FOUND" | "HLS_SUBTITLE_TRACK_AMBIGUOUS" | "HLS_SUBTITLE_SWITCH_FAILED" | "HLS_SUBTITLE_SWITCH_TIMEOUT";
|
|
4067
|
+
/** {zh}
|
|
4068
|
+
* @brief HLS Level、ABR 或字幕控制失败时抛出的标准错误。
|
|
4069
|
+
* @detail Api
|
|
4070
|
+
*/
|
|
4071
|
+
/** {en}
|
|
4072
|
+
* @brief Standard error thrown when HLS Level, ABR, or subtitle control fails.
|
|
4073
|
+
* @detail Api
|
|
4074
|
+
*/
|
|
4075
|
+
export declare class HlsControlError extends Error {
|
|
4076
|
+
/** {zh} @brief 稳定的 HLS 控制错误码。 */
|
|
4077
|
+
/** {en} @brief Stable HLS control error code. */
|
|
4078
|
+
readonly code: HlsControlErrorCode;
|
|
4079
|
+
constructor(code: HlsControlErrorCode, message: string);
|
|
4080
|
+
}
|
|
3431
4081
|
export declare type TAPIRegionConfig = {
|
|
3432
4082
|
__PLAY_DOMAIN__: string;
|
|
3433
4083
|
__BACKUP_PLAY_DOMAIN__?: string;
|
|
@@ -4699,6 +5349,7 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
4699
5349
|
* - **Android**:直接启用 hls.js 播放。
|
|
4700
5350
|
* - **iOS**:仅在设备支持 `ManagedMediaSource`(iOS 17.1+,即 `VePlayer.isMMSSupported()` 为 `true`)时启用;
|
|
4701
5351
|
* 不满足时自动回退至原生 HLS 播放。
|
|
5352
|
+
* - **`isMobile` 模拟模式**:当前浏览器支持 MSE 或 MMS 时启用 hls.js。
|
|
4702
5353
|
* 开启后可在移动端解锁多音轨切换、`setAudioOption` 偏好持久化等 hls.js 特有能力。
|
|
4703
5354
|
* @default false
|
|
4704
5355
|
*/
|
|
@@ -4707,13 +5358,82 @@ export interface IPlayerConfig extends IPlayerOptions {
|
|
|
4707
5358
|
* - **Android**: always enables hls.js.
|
|
4708
5359
|
* - **iOS**: enables hls.js only when `ManagedMediaSource` is supported (iOS 17.1+,
|
|
4709
5360
|
* i.e. `VePlayer.isMMSSupported()` returns `true`); falls back to native HLS otherwise.
|
|
5361
|
+
* - **`isMobile` simulation**: enables hls.js when the current browser supports MSE or MMS.
|
|
4710
5362
|
* Unlocks hls.js-specific features such as multi-audio-track switching on mobile.
|
|
4711
5363
|
* @default false
|
|
4712
5364
|
*/
|
|
4713
5365
|
enableMobileHlsPlugin?: boolean;
|
|
4714
5366
|
/** {zh}
|
|
4715
|
-
* @brief
|
|
4716
|
-
* @
|
|
5367
|
+
* @brief 清晰度插件手动切换 HLS Level 时使用的切换模式。
|
|
5368
|
+
* @notes 仅在 hls.js/MSE/MMS 模式下生效;默认值为 `next-fragment`。直接调用 `setHlsLevel()` 时,以方法参数中的 `mode` 为准。
|
|
5369
|
+
* @default next-fragment
|
|
5370
|
+
* @example
|
|
5371
|
+
* ``` javascript
|
|
5372
|
+
* const playerSdkIns = new VePlayer({
|
|
5373
|
+
* hlsLevelSwitchMode: 'smooth'
|
|
5374
|
+
* });
|
|
5375
|
+
* ```
|
|
5376
|
+
*/
|
|
5377
|
+
/** {en}
|
|
5378
|
+
* @brief Switching mode used when the quality plugin manually selects an HLS Level.
|
|
5379
|
+
* @notes Effective only in hls.js/MSE/MMS mode. Defaults to `next-fragment`. A `mode` passed directly to `setHlsLevel()` takes precedence for that call.
|
|
5380
|
+
* @default next-fragment
|
|
5381
|
+
* @example
|
|
5382
|
+
* ``` javascript
|
|
5383
|
+
* const playerSdkIns = new VePlayer({
|
|
5384
|
+
* hlsLevelSwitchMode: 'smooth'
|
|
5385
|
+
* });
|
|
5386
|
+
* ```
|
|
5387
|
+
*/
|
|
5388
|
+
hlsLevelSwitchMode?: HlsLevelSwitchMode;
|
|
5389
|
+
/** {zh}
|
|
5390
|
+
* @brief Master M3U8 的 HLS Level 标签多语言映射与自定义格式化配置。
|
|
5391
|
+
* @notes 仅影响内置清晰度插件的展示文案,不改变 Level 索引、切档行为或 ABR 决策。映射 key 为视频短边生成的标准标签,例如 `720p`、`1080p`。
|
|
5392
|
+
* @default -
|
|
5393
|
+
* @example
|
|
5394
|
+
* ``` javascript
|
|
5395
|
+
* const playerSdkIns = new VePlayer({
|
|
5396
|
+
* lang: 'zh',
|
|
5397
|
+
* languages: {
|
|
5398
|
+
* zh: { HLS_LEVEL_HD: '高清' },
|
|
5399
|
+
* en: { HLS_LEVEL_HD: 'HD' }
|
|
5400
|
+
* },
|
|
5401
|
+
* hlsLevelLabel: {
|
|
5402
|
+
* map: {
|
|
5403
|
+
* '720p': { textKey: 'HLS_LEVEL_HD', text: '720p' }
|
|
5404
|
+
* },
|
|
5405
|
+
* formatter: ({ defaultLabel, level }) =>
|
|
5406
|
+
* level.videoRange === 'PQ' ? `${defaultLabel} HDR` : defaultLabel
|
|
5407
|
+
* }
|
|
5408
|
+
* });
|
|
5409
|
+
* ```
|
|
5410
|
+
*/
|
|
5411
|
+
/** {en}
|
|
5412
|
+
* @brief Localization mapping and custom formatter for Master M3U8 HLS Level labels.
|
|
5413
|
+
* @notes Only changes labels rendered by the built-in quality plugin. It does not change Level indices, switching behavior, or ABR decisions. Mapping keys are canonical short-edge labels such as `720p` and `1080p`.
|
|
5414
|
+
* @default -
|
|
5415
|
+
* @example
|
|
5416
|
+
* ``` javascript
|
|
5417
|
+
* const playerSdkIns = new VePlayer({
|
|
5418
|
+
* lang: 'en',
|
|
5419
|
+
* languages: {
|
|
5420
|
+
* zh: { HLS_LEVEL_HD: '高清' },
|
|
5421
|
+
* en: { HLS_LEVEL_HD: 'HD' }
|
|
5422
|
+
* },
|
|
5423
|
+
* hlsLevelLabel: {
|
|
5424
|
+
* map: {
|
|
5425
|
+
* '720p': { textKey: 'HLS_LEVEL_HD', text: '720p' }
|
|
5426
|
+
* },
|
|
5427
|
+
* formatter: ({ defaultLabel, level }) =>
|
|
5428
|
+
* level.videoRange === 'PQ' ? `${defaultLabel} HDR` : defaultLabel
|
|
5429
|
+
* }
|
|
5430
|
+
* });
|
|
5431
|
+
* ```
|
|
5432
|
+
*/
|
|
5433
|
+
hlsLevelLabel?: IHlsLevelLabelOptions;
|
|
5434
|
+
/** {zh}
|
|
5435
|
+
* @brief 是否启用 {@link https://hlsjs.video-dev.org/ hls.js} 插件播放HLS视频,默认为true,设置为false后,PC端播放HLS使用自研hls插件播放HLS视频
|
|
5436
|
+
* @default true
|
|
4717
5437
|
*/
|
|
4718
5438
|
/** {en}
|
|
4719
5439
|
* @brief Whether to use the {@link https://hlsjs.video-dev.org/ hls.js} plugin for HLS playback on PC. When `false`, the built-in HLS adapter is used instead.
|
|
@@ -6588,6 +7308,238 @@ declare abstract class AbstractBaseAdapter {
|
|
|
6588
7308
|
abstract getPlugins(umdLoader: UMDLoader): Promise<XGPlugin[]>;
|
|
6589
7309
|
abstract setPluginConfigInVid(videoInfo: IVideoInfo, context: AuthToken): void;
|
|
6590
7310
|
}
|
|
7311
|
+
/** {zh}
|
|
7312
|
+
* @list Options
|
|
7313
|
+
* @brief 字幕项。
|
|
7314
|
+
* @kind property
|
|
7315
|
+
*/
|
|
7316
|
+
/** {en}
|
|
7317
|
+
* @list Options
|
|
7318
|
+
* @brief Subtitle item.
|
|
7319
|
+
* @kind property
|
|
7320
|
+
*/
|
|
7321
|
+
export interface ISubTitleItem {
|
|
7322
|
+
/** {zh}
|
|
7323
|
+
* @brief 字幕来源。业务配置字幕为 `config`,Master M3U8 或原生 HLS 字幕为 `hls`。
|
|
7324
|
+
* @default config
|
|
7325
|
+
*/
|
|
7326
|
+
/** {en}
|
|
7327
|
+
* @brief Subtitle source. Business-configured subtitles use `config`; Master M3U8 or native HLS subtitles use `hls`.
|
|
7328
|
+
* @default config
|
|
7329
|
+
*/
|
|
7330
|
+
source?: "config" | "hls";
|
|
7331
|
+
/** {zh}
|
|
7332
|
+
* @brief 字幕语言。
|
|
7333
|
+
* @default -
|
|
7334
|
+
*/
|
|
7335
|
+
/** {en}
|
|
7336
|
+
* @brief Subtitle language.
|
|
7337
|
+
* @default -
|
|
7338
|
+
*/
|
|
7339
|
+
language?: string | number;
|
|
7340
|
+
/** {zh}
|
|
7341
|
+
* @brief 字幕 ID。
|
|
7342
|
+
* @default -
|
|
7343
|
+
*/
|
|
7344
|
+
/** {en}
|
|
7345
|
+
* @brief Subtitle ID.
|
|
7346
|
+
* @default -
|
|
7347
|
+
*/
|
|
7348
|
+
id?: number | string;
|
|
7349
|
+
/** {zh}
|
|
7350
|
+
* @brief 是否为默认选择的字幕。
|
|
7351
|
+
* @default false
|
|
7352
|
+
*/
|
|
7353
|
+
/** {en}
|
|
7354
|
+
* @brief Whether this is the default selected subtitle.
|
|
7355
|
+
* @default false
|
|
7356
|
+
*/
|
|
7357
|
+
isDefault?: boolean;
|
|
7358
|
+
/** {zh}
|
|
7359
|
+
* @brief 是否为强制字幕轨。
|
|
7360
|
+
* @default false
|
|
7361
|
+
*/
|
|
7362
|
+
/** {en}
|
|
7363
|
+
* @brief Whether the subtitle track is forced.
|
|
7364
|
+
* @default false
|
|
7365
|
+
*/
|
|
7366
|
+
forced?: boolean;
|
|
7367
|
+
/** {zh}
|
|
7368
|
+
* @brief HLS 字幕轨的特征标识,例如无障碍字幕特征;未声明时为空。
|
|
7369
|
+
* @default -
|
|
7370
|
+
*/
|
|
7371
|
+
/** {en}
|
|
7372
|
+
* @brief HLS subtitle-track characteristics, such as accessibility traits; absent when not declared.
|
|
7373
|
+
* @default -
|
|
7374
|
+
*/
|
|
7375
|
+
characteristics?: string;
|
|
7376
|
+
/** {zh}
|
|
7377
|
+
* @brief 字幕名称。
|
|
7378
|
+
* @default -
|
|
7379
|
+
*/
|
|
7380
|
+
/** {en}
|
|
7381
|
+
* @brief Subtitle display name.
|
|
7382
|
+
* @default -
|
|
7383
|
+
*/
|
|
7384
|
+
text?: ISubtitleLabelValue;
|
|
7385
|
+
/** {zh}
|
|
7386
|
+
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
7387
|
+
* @default -
|
|
7388
|
+
*/
|
|
7389
|
+
/** {en}
|
|
7390
|
+
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
7391
|
+
* @default -
|
|
7392
|
+
*/
|
|
7393
|
+
label?: ISubtitleLabelValue;
|
|
7394
|
+
/** {zh}
|
|
7395
|
+
* @brief 外挂字幕 URL 地址。
|
|
7396
|
+
* @default -
|
|
7397
|
+
*/
|
|
7398
|
+
/** {en}
|
|
7399
|
+
* @brief External subtitle URL.
|
|
7400
|
+
* @default -
|
|
7401
|
+
*/
|
|
7402
|
+
url?: string;
|
|
7403
|
+
/**
|
|
7404
|
+
* @hidden
|
|
7405
|
+
* @type {string}
|
|
7406
|
+
* @memberof ISubTitleItem
|
|
7407
|
+
*/
|
|
7408
|
+
stringContent?: string;
|
|
7409
|
+
/** {zh}
|
|
7410
|
+
* @brief 字幕内容列表。非 `url` 形式时使用。
|
|
7411
|
+
* @default -
|
|
7412
|
+
* @type {Array<Object>}
|
|
7413
|
+
* @memberof ISubTitleItem
|
|
7414
|
+
*/
|
|
7415
|
+
/** {en}
|
|
7416
|
+
* @brief Subtitle content list when not using URL.
|
|
7417
|
+
* @default -
|
|
7418
|
+
* @type {Array<Object>}
|
|
7419
|
+
* @memberof ISubTitleItem
|
|
7420
|
+
*/
|
|
7421
|
+
list?: IListItem[];
|
|
7422
|
+
}
|
|
7423
|
+
/** {zh}
|
|
7424
|
+
* @brief 字幕项名称,可为静态文案或按播放器语言配置的文案表。
|
|
7425
|
+
* @detail ref
|
|
7426
|
+
*/
|
|
7427
|
+
/** {en}
|
|
7428
|
+
* @brief Subtitle item name as static text or a text map keyed by player language.
|
|
7429
|
+
* @detail ref
|
|
7430
|
+
*/
|
|
7431
|
+
export type ISubtitleLabelValue = string | number | Record<string, string | number>;
|
|
7432
|
+
/** {zh}
|
|
7433
|
+
* @brief 字幕内容项。
|
|
7434
|
+
* @list Options
|
|
7435
|
+
* @kind property
|
|
7436
|
+
* @export
|
|
7437
|
+
* @interface IListItem
|
|
7438
|
+
*/
|
|
7439
|
+
/** {en}
|
|
7440
|
+
* @brief Subtitle content item.
|
|
7441
|
+
* @list Options
|
|
7442
|
+
* @kind property
|
|
7443
|
+
* @export
|
|
7444
|
+
* @interface IListItem
|
|
7445
|
+
*/
|
|
7446
|
+
export interface IListItem {
|
|
7447
|
+
/** {zh}
|
|
7448
|
+
* @brief 开始时间,单位为秒。
|
|
7449
|
+
* @type {number}
|
|
7450
|
+
*/
|
|
7451
|
+
/** {en}
|
|
7452
|
+
* @brief Start time in seconds.
|
|
7453
|
+
* @type {number}
|
|
7454
|
+
*/
|
|
7455
|
+
start: number;
|
|
7456
|
+
/** {zh}
|
|
7457
|
+
* @brief 结束时间,单位为秒。
|
|
7458
|
+
* @type {number}
|
|
7459
|
+
*/
|
|
7460
|
+
/** {en}
|
|
7461
|
+
* @brief End time in seconds.
|
|
7462
|
+
* @type {number}
|
|
7463
|
+
*/
|
|
7464
|
+
end: number;
|
|
7465
|
+
/** {zh}
|
|
7466
|
+
* @brief 字幕数据列表。
|
|
7467
|
+
* @type {Array<ITextItem>}
|
|
7468
|
+
*/
|
|
7469
|
+
/** {en}
|
|
7470
|
+
* @brief Subtitle cue data list.
|
|
7471
|
+
* @type {Array<ITextItem>}
|
|
7472
|
+
*/
|
|
7473
|
+
list: Array<ITextItem>;
|
|
7474
|
+
/**
|
|
7475
|
+
* @hidden
|
|
7476
|
+
* @type {any}
|
|
7477
|
+
*/
|
|
7478
|
+
[propName: string]: any;
|
|
7479
|
+
}
|
|
7480
|
+
/** {zh}
|
|
7481
|
+
* @brief 字幕文案配置。
|
|
7482
|
+
* @list Options
|
|
7483
|
+
* @kind property
|
|
7484
|
+
*/
|
|
7485
|
+
/** {en}
|
|
7486
|
+
* @brief Subtitle text item configuration.
|
|
7487
|
+
* @list Options
|
|
7488
|
+
* @kind property
|
|
7489
|
+
*/
|
|
7490
|
+
export interface ITextItem {
|
|
7491
|
+
/**
|
|
7492
|
+
* @hidden
|
|
7493
|
+
* @type {any}
|
|
7494
|
+
*/
|
|
7495
|
+
[propName: string]: any;
|
|
7496
|
+
/** {zh}
|
|
7497
|
+
* @brief 开始时间,单位为秒。
|
|
7498
|
+
* @type {number}
|
|
7499
|
+
*/
|
|
7500
|
+
/** {en}
|
|
7501
|
+
* @brief Start time in seconds.
|
|
7502
|
+
* @type {number}
|
|
7503
|
+
*/
|
|
7504
|
+
start: number;
|
|
7505
|
+
/** {zh}
|
|
7506
|
+
* @brief 结束时间,单位为秒。
|
|
7507
|
+
* @type {number}
|
|
7508
|
+
*/
|
|
7509
|
+
/** {en}
|
|
7510
|
+
* @brief End time in seconds.
|
|
7511
|
+
* @type {number}
|
|
7512
|
+
*/
|
|
7513
|
+
end: number;
|
|
7514
|
+
/** {zh}
|
|
7515
|
+
* @brief 字幕文案数组。
|
|
7516
|
+
* @type {string[]}
|
|
7517
|
+
*/
|
|
7518
|
+
/** {en}
|
|
7519
|
+
* @brief Subtitle text array.
|
|
7520
|
+
* @type {string[]}
|
|
7521
|
+
*/
|
|
7522
|
+
text: string[];
|
|
7523
|
+
/** {zh}
|
|
7524
|
+
* @brief 字幕顺序。
|
|
7525
|
+
* @type {number}
|
|
7526
|
+
*/
|
|
7527
|
+
/** {en}
|
|
7528
|
+
* @brief Subtitle display order.
|
|
7529
|
+
* @type {number}
|
|
7530
|
+
*/
|
|
7531
|
+
index?: number;
|
|
7532
|
+
}
|
|
7533
|
+
/** {zh}
|
|
7534
|
+
* @brief HLS 自动码率决策引擎配置值。
|
|
7535
|
+
* @detail ref
|
|
7536
|
+
*/
|
|
7537
|
+
/** {en}
|
|
7538
|
+
* @brief Configurable HLS adaptive-bitrate decision engine.
|
|
7539
|
+
* @detail ref
|
|
7540
|
+
*/
|
|
7541
|
+
export type HlsAbrEngine = "hlsjs" | "veplayer";
|
|
7542
|
+
export type TLogChannel = "cn" | "va" | "sg";
|
|
6591
7543
|
declare class PlayerData {
|
|
6592
7544
|
id?: string;
|
|
6593
7545
|
root?: HTMLElement;
|
|
@@ -6689,6 +7641,8 @@ declare class PlayerData {
|
|
|
6689
7641
|
*/
|
|
6690
7642
|
getCurrentStreamType(): string;
|
|
6691
7643
|
getStreamType(): string;
|
|
7644
|
+
getConfiguredHlsAbrEngine(): HlsAbrEngine;
|
|
7645
|
+
isOpenVePlayerABR(): boolean;
|
|
6692
7646
|
isOpenABR(): boolean;
|
|
6693
7647
|
showRealDefinition(): boolean;
|
|
6694
7648
|
isAutoDefinition(def: any): boolean;
|
|
@@ -7063,205 +8017,18 @@ export declare type IMediaInfoPrefetchFailure = {
|
|
|
7063
8017
|
export declare type IMediaInfoPrefetchResult = IMediaInfoPrefetchSuccess | IMediaInfoPrefetchFailure;
|
|
7064
8018
|
export declare type IPreloadStream = IPreloadResolvedStream | IPreloadDramaStream | IPreloadAuthTokenStream;
|
|
7065
8019
|
/** {zh}
|
|
7066
|
-
* @
|
|
7067
|
-
*
|
|
7068
|
-
* @
|
|
8020
|
+
* @hidden
|
|
8021
|
+
* h265策略配置
|
|
8022
|
+
* @detail Options
|
|
7069
8023
|
*/
|
|
7070
8024
|
/** {en}
|
|
7071
|
-
* @
|
|
7072
|
-
* @brief
|
|
7073
|
-
* @
|
|
8025
|
+
* @hidden
|
|
8026
|
+
* @brief H.265 strategy configuration.
|
|
8027
|
+
* @detail Options
|
|
7074
8028
|
*/
|
|
7075
|
-
export
|
|
8029
|
+
export declare type IH265Config = {
|
|
7076
8030
|
/** {zh}
|
|
7077
|
-
* @brief
|
|
7078
|
-
* @default -
|
|
7079
|
-
*/
|
|
7080
|
-
/** {en}
|
|
7081
|
-
* @brief Subtitle language.
|
|
7082
|
-
* @default -
|
|
7083
|
-
*/
|
|
7084
|
-
language?: string | number;
|
|
7085
|
-
/** {zh}
|
|
7086
|
-
* @brief 字幕 ID。
|
|
7087
|
-
* @default -
|
|
7088
|
-
*/
|
|
7089
|
-
/** {en}
|
|
7090
|
-
* @brief Subtitle ID.
|
|
7091
|
-
* @default -
|
|
7092
|
-
*/
|
|
7093
|
-
id?: number | string;
|
|
7094
|
-
/** {zh}
|
|
7095
|
-
* @brief 是否为默认选择的字幕。
|
|
7096
|
-
* @default false
|
|
7097
|
-
*/
|
|
7098
|
-
/** {en}
|
|
7099
|
-
* @brief Whether this is the default selected subtitle.
|
|
7100
|
-
* @default false
|
|
7101
|
-
*/
|
|
7102
|
-
isDefault?: boolean;
|
|
7103
|
-
/** {zh}
|
|
7104
|
-
* @brief 字幕名称。
|
|
7105
|
-
* @default -
|
|
7106
|
-
*/
|
|
7107
|
-
/** {en}
|
|
7108
|
-
* @brief Subtitle display name.
|
|
7109
|
-
* @default -
|
|
7110
|
-
*/
|
|
7111
|
-
text?: string;
|
|
7112
|
-
/** {zh}
|
|
7113
|
-
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
7114
|
-
* @default -
|
|
7115
|
-
*/
|
|
7116
|
-
/** {en}
|
|
7117
|
-
* @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
|
|
7118
|
-
* @default -
|
|
7119
|
-
*/
|
|
7120
|
-
label?: string | number;
|
|
7121
|
-
/** {zh}
|
|
7122
|
-
* @brief 外挂字幕 URL 地址。
|
|
7123
|
-
* @default -
|
|
7124
|
-
*/
|
|
7125
|
-
/** {en}
|
|
7126
|
-
* @brief External subtitle URL.
|
|
7127
|
-
* @default -
|
|
7128
|
-
*/
|
|
7129
|
-
url?: string;
|
|
7130
|
-
/**
|
|
7131
|
-
* @hidden
|
|
7132
|
-
* @type {string}
|
|
7133
|
-
* @memberof ISubTitleItem
|
|
7134
|
-
*/
|
|
7135
|
-
stringContent?: string;
|
|
7136
|
-
/** {zh}
|
|
7137
|
-
* @brief 字幕内容列表。非 `url` 形式时使用。
|
|
7138
|
-
* @default -
|
|
7139
|
-
* @type {Array<Object>}
|
|
7140
|
-
* @memberof ISubTitleItem
|
|
7141
|
-
*/
|
|
7142
|
-
/** {en}
|
|
7143
|
-
* @brief Subtitle content list when not using URL.
|
|
7144
|
-
* @default -
|
|
7145
|
-
* @type {Array<Object>}
|
|
7146
|
-
* @memberof ISubTitleItem
|
|
7147
|
-
*/
|
|
7148
|
-
list?: IListItem[];
|
|
7149
|
-
}
|
|
7150
|
-
/** {zh}
|
|
7151
|
-
* @brief 字幕内容项。
|
|
7152
|
-
* @list Options
|
|
7153
|
-
* @kind property
|
|
7154
|
-
* @export
|
|
7155
|
-
* @interface IListItem
|
|
7156
|
-
*/
|
|
7157
|
-
/** {en}
|
|
7158
|
-
* @brief Subtitle content item.
|
|
7159
|
-
* @list Options
|
|
7160
|
-
* @kind property
|
|
7161
|
-
* @export
|
|
7162
|
-
* @interface IListItem
|
|
7163
|
-
*/
|
|
7164
|
-
export interface IListItem {
|
|
7165
|
-
/** {zh}
|
|
7166
|
-
* @brief 开始时间,单位为秒。
|
|
7167
|
-
* @type {number}
|
|
7168
|
-
*/
|
|
7169
|
-
/** {en}
|
|
7170
|
-
* @brief Start time in seconds.
|
|
7171
|
-
* @type {number}
|
|
7172
|
-
*/
|
|
7173
|
-
start: number;
|
|
7174
|
-
/** {zh}
|
|
7175
|
-
* @brief 结束时间,单位为秒。
|
|
7176
|
-
* @type {number}
|
|
7177
|
-
*/
|
|
7178
|
-
/** {en}
|
|
7179
|
-
* @brief End time in seconds.
|
|
7180
|
-
* @type {number}
|
|
7181
|
-
*/
|
|
7182
|
-
end: number;
|
|
7183
|
-
/** {zh}
|
|
7184
|
-
* @brief 字幕数据列表。
|
|
7185
|
-
* @type {Array<ITextItem>}
|
|
7186
|
-
*/
|
|
7187
|
-
/** {en}
|
|
7188
|
-
* @brief Subtitle cue data list.
|
|
7189
|
-
* @type {Array<ITextItem>}
|
|
7190
|
-
*/
|
|
7191
|
-
list: Array<ITextItem>;
|
|
7192
|
-
/**
|
|
7193
|
-
* @hidden
|
|
7194
|
-
* @type {any}
|
|
7195
|
-
*/
|
|
7196
|
-
[propName: string]: any;
|
|
7197
|
-
}
|
|
7198
|
-
/** {zh}
|
|
7199
|
-
* @brief 字幕文案配置。
|
|
7200
|
-
* @list Options
|
|
7201
|
-
* @kind property
|
|
7202
|
-
*/
|
|
7203
|
-
/** {en}
|
|
7204
|
-
* @brief Subtitle text item configuration.
|
|
7205
|
-
* @list Options
|
|
7206
|
-
* @kind property
|
|
7207
|
-
*/
|
|
7208
|
-
export interface ITextItem {
|
|
7209
|
-
/**
|
|
7210
|
-
* @hidden
|
|
7211
|
-
* @type {any}
|
|
7212
|
-
*/
|
|
7213
|
-
[propName: string]: any;
|
|
7214
|
-
/** {zh}
|
|
7215
|
-
* @brief 开始时间,单位为秒。
|
|
7216
|
-
* @type {number}
|
|
7217
|
-
*/
|
|
7218
|
-
/** {en}
|
|
7219
|
-
* @brief Start time in seconds.
|
|
7220
|
-
* @type {number}
|
|
7221
|
-
*/
|
|
7222
|
-
start: number;
|
|
7223
|
-
/** {zh}
|
|
7224
|
-
* @brief 结束时间,单位为秒。
|
|
7225
|
-
* @type {number}
|
|
7226
|
-
*/
|
|
7227
|
-
/** {en}
|
|
7228
|
-
* @brief End time in seconds.
|
|
7229
|
-
* @type {number}
|
|
7230
|
-
*/
|
|
7231
|
-
end: number;
|
|
7232
|
-
/** {zh}
|
|
7233
|
-
* @brief 字幕文案数组。
|
|
7234
|
-
* @type {string[]}
|
|
7235
|
-
*/
|
|
7236
|
-
/** {en}
|
|
7237
|
-
* @brief Subtitle text array.
|
|
7238
|
-
* @type {string[]}
|
|
7239
|
-
*/
|
|
7240
|
-
text: string[];
|
|
7241
|
-
/** {zh}
|
|
7242
|
-
* @brief 字幕顺序。
|
|
7243
|
-
* @type {number}
|
|
7244
|
-
*/
|
|
7245
|
-
/** {en}
|
|
7246
|
-
* @brief Subtitle display order.
|
|
7247
|
-
* @type {number}
|
|
7248
|
-
*/
|
|
7249
|
-
index?: number;
|
|
7250
|
-
}
|
|
7251
|
-
export type TLogChannel = "cn" | "va" | "sg";
|
|
7252
|
-
/** {zh}
|
|
7253
|
-
* @hidden
|
|
7254
|
-
* h265策略配置
|
|
7255
|
-
* @detail Options
|
|
7256
|
-
*/
|
|
7257
|
-
/** {en}
|
|
7258
|
-
* @hidden
|
|
7259
|
-
* @brief H.265 strategy configuration.
|
|
7260
|
-
* @detail Options
|
|
7261
|
-
*/
|
|
7262
|
-
export declare type IH265Config = {
|
|
7263
|
-
/** {zh}
|
|
7264
|
-
* @brief h265策略依赖Module
|
|
8031
|
+
* @brief h265策略依赖Module
|
|
7265
8032
|
*/
|
|
7266
8033
|
/** {en}
|
|
7267
8034
|
* @brief H.265 strategy dependency module.
|
|
@@ -7757,6 +8524,14 @@ declare class VePlayer {
|
|
|
7757
8524
|
* @memberof VePlayer
|
|
7758
8525
|
*/
|
|
7759
8526
|
private _emitter;
|
|
8527
|
+
/** @hidden 当前播放内核对应的 Master M3U8 Level 控制器。 */
|
|
8528
|
+
private _hlsMasterController;
|
|
8529
|
+
/** @hidden 当前播放内核对应的 Master M3U8 字幕适配器。 */
|
|
8530
|
+
private _hlsSubtitleAdapter;
|
|
8531
|
+
/** @hidden 当前播放世代中业务显式配置的字幕列表快照。 */
|
|
8532
|
+
private _explicitSubtitleListSnapshot;
|
|
8533
|
+
/** @hidden 在播放会话提交后刷新 Level 快照与事件归属。 */
|
|
8534
|
+
private _hlsMasterRefreshListener?;
|
|
7760
8535
|
/** 最近一次用户选择的音轨,用于清晰度切换后通过 setAudioOption 恢复音轨 */
|
|
7761
8536
|
private _lastSelectedAudioTrack;
|
|
7762
8537
|
/**
|
|
@@ -8315,6 +9090,14 @@ declare class VePlayer {
|
|
|
8315
9090
|
* @memberof VePlayer
|
|
8316
9091
|
*/
|
|
8317
9092
|
afterPlayerCreate(): void;
|
|
9093
|
+
/** @hidden 为当前播放内核挂载会话隔离的 Master M3U8 Level 控制器。 */
|
|
9094
|
+
private _mountHlsMasterController;
|
|
9095
|
+
/** @hidden 为当前 hls.js 播放会话挂载安全的 Master 字幕适配器。 */
|
|
9096
|
+
private _mountHlsSubtitleAdapter;
|
|
9097
|
+
/** @hidden 克隆业务字幕策略,避免由运行时注入列表反推来源。 */
|
|
9098
|
+
private _cloneExplicitSubtitleList;
|
|
9099
|
+
/** @hidden 返回稳定的 Level 会话刷新监听器,便于销毁时精确解绑。 */
|
|
9100
|
+
private _getHlsMasterRefreshListener;
|
|
8318
9101
|
_setVeError(): void;
|
|
8319
9102
|
/**
|
|
8320
9103
|
* @hidden
|
|
@@ -8629,12 +9412,177 @@ declare class VePlayer {
|
|
|
8629
9412
|
/** {en}
|
|
8630
9413
|
* @brief Get the definition list. Each item has `definition`, `url`, and `selected` (true for the active level).
|
|
8631
9414
|
*/
|
|
8632
|
-
getDefinitionList(): Array<{
|
|
8633
|
-
definition: string;
|
|
8634
|
-
url: IUrl;
|
|
8635
|
-
selected: boolean;
|
|
8636
|
-
[propName: string]: any;
|
|
8637
|
-
}>;
|
|
9415
|
+
getDefinitionList(): Array<{
|
|
9416
|
+
definition: string;
|
|
9417
|
+
url: IUrl;
|
|
9418
|
+
selected: boolean;
|
|
9419
|
+
[propName: string]: any;
|
|
9420
|
+
}>;
|
|
9421
|
+
/** {zh}
|
|
9422
|
+
* @brief 获取当前播放会话中由 Master M3U8 解析出的 HLS Level 列表。
|
|
9423
|
+
* @list Api
|
|
9424
|
+
* @returns 标准化后的 HLS Level 快照;Manifest 未就绪或当前不是 hls.js 内核时返回空数组。
|
|
9425
|
+
* @notes Level 的 `index` 只在当前 `playbackSessionId` 内有效;返回结果不包含播放地址和鉴权信息。
|
|
9426
|
+
* @example
|
|
9427
|
+
* ``` javascript
|
|
9428
|
+
* const levels = playerSdkIns.getHlsLevels();
|
|
9429
|
+
* console.log(levels.map(level => `${level.height}p`));
|
|
9430
|
+
* ```
|
|
9431
|
+
*/
|
|
9432
|
+
/** {en}
|
|
9433
|
+
* @brief Get HLS Levels parsed from the Master M3U8 for the current playback session.
|
|
9434
|
+
* @list Api
|
|
9435
|
+
* @returns A normalized HLS Level snapshot. Returns an empty array before the manifest is ready or when hls.js is not the active engine.
|
|
9436
|
+
* @notes A Level `index` is valid only for the current `playbackSessionId`. Playback URLs and authorization data are never returned.
|
|
9437
|
+
* @example
|
|
9438
|
+
* ``` javascript
|
|
9439
|
+
* const levels = playerSdkIns.getHlsLevels();
|
|
9440
|
+
* console.log(levels.map(level => `${level.height}p`));
|
|
9441
|
+
* ```
|
|
9442
|
+
*/
|
|
9443
|
+
getHlsLevels(): IHlsLevel[];
|
|
9444
|
+
/** {zh}
|
|
9445
|
+
* @brief 获取当前播放会话的 HLS Level 状态。
|
|
9446
|
+
* @list Api
|
|
9447
|
+
* @returns HLS Level 状态快照,包含列表就绪状态、实际档位、手动档位和自动选档上限。
|
|
9448
|
+
* @notes `READY` 事件不表示 Level 列表已经就绪;请检查返回值的 `ready`,或监听 `HLS_LEVELS_UPDATED`。
|
|
9449
|
+
* @example
|
|
9450
|
+
* ``` javascript
|
|
9451
|
+
* const state = playerSdkIns.getHlsLevelState();
|
|
9452
|
+
* if (state.ready) {
|
|
9453
|
+
* console.log(state.currentLevel, state.autoLevelEnabled);
|
|
9454
|
+
* }
|
|
9455
|
+
* ```
|
|
9456
|
+
*/
|
|
9457
|
+
/** {en}
|
|
9458
|
+
* @brief Get HLS Level state for the current playback session.
|
|
9459
|
+
* @list Api
|
|
9460
|
+
* @returns An HLS Level state snapshot including readiness, active and manual Levels, and the automatic Level cap.
|
|
9461
|
+
* @notes The `READY` event does not mean the Level list is ready. Check `ready` or listen for `HLS_LEVELS_UPDATED`.
|
|
9462
|
+
* @example
|
|
9463
|
+
* ``` javascript
|
|
9464
|
+
* const state = playerSdkIns.getHlsLevelState();
|
|
9465
|
+
* if (state.ready) {
|
|
9466
|
+
* console.log(state.currentLevel, state.autoLevelEnabled);
|
|
9467
|
+
* }
|
|
9468
|
+
* ```
|
|
9469
|
+
*/
|
|
9470
|
+
getHlsLevelState(): IHlsLevelState;
|
|
9471
|
+
/** {zh}
|
|
9472
|
+
* @brief 手动切换当前 Master M3U8 的 HLS Level。
|
|
9473
|
+
* @list Api
|
|
9474
|
+
* @param levelIndex 目标 Level 索引,可通过 `getHlsLevels()` 获取。
|
|
9475
|
+
* @param options 切换模式和可选的播放会话 ID。
|
|
9476
|
+
* @notes 调用后进入手动选档。目标提交时触发 `HLS_LEVEL_SWITCHING`,实际生效后触发 `HLS_LEVEL_SWITCHED`。Manifest 未就绪、内核不支持、索引越界或会话过期时抛出 {@link HlsControlError}。
|
|
9477
|
+
* @example
|
|
9478
|
+
* ``` javascript
|
|
9479
|
+
* const state = playerSdkIns.getHlsLevelState();
|
|
9480
|
+
* playerSdkIns.setHlsLevel(1, {
|
|
9481
|
+
* mode: 'next-fragment',
|
|
9482
|
+
* playbackSessionId: state.playbackSessionId
|
|
9483
|
+
* });
|
|
9484
|
+
* ```
|
|
9485
|
+
*/
|
|
9486
|
+
/** {en}
|
|
9487
|
+
* @brief Manually switch the HLS Level in the current Master M3U8.
|
|
9488
|
+
* @list Api
|
|
9489
|
+
* @param levelIndex Target Level index from `getHlsLevels()`.
|
|
9490
|
+
* @param options Switching mode and optional playback session ID.
|
|
9491
|
+
* @notes Calling this method enters manual Level selection. `HLS_LEVEL_SWITCHING` fires when submitted, and `HLS_LEVEL_SWITCHED` fires after it takes effect. A {@link HlsControlError} is thrown when the manifest is not ready, the engine is unsupported, the index is invalid, or the session has expired.
|
|
9492
|
+
* @example
|
|
9493
|
+
* ``` javascript
|
|
9494
|
+
* const state = playerSdkIns.getHlsLevelState();
|
|
9495
|
+
* playerSdkIns.setHlsLevel(1, {
|
|
9496
|
+
* mode: 'next-fragment',
|
|
9497
|
+
* playbackSessionId: state.playbackSessionId
|
|
9498
|
+
* });
|
|
9499
|
+
* ```
|
|
9500
|
+
*/
|
|
9501
|
+
setHlsLevel(levelIndex: number, options?: IHlsLevelSwitchOptions): void;
|
|
9502
|
+
/** {zh}
|
|
9503
|
+
* @brief 获取当前播放会话的 HLS ABR 引擎、模式、可用性和控制能力。
|
|
9504
|
+
* @list Api
|
|
9505
|
+
* @returns 当前 HLS ABR 状态快照。
|
|
9506
|
+
* @notes `engine` 是实际解析出的决策引擎;`configuredEngine` 只表示已生效的显式配置。请使用 `decisionSource` 决定清晰度 UI 展示 Level 还是 Definition。
|
|
9507
|
+
* @example
|
|
9508
|
+
* ``` javascript
|
|
9509
|
+
* const state = playerSdkIns.getHlsAbrState();
|
|
9510
|
+
* console.log(state.engine, state.mode, state.decisionSource);
|
|
9511
|
+
* ```
|
|
9512
|
+
*/
|
|
9513
|
+
/** {en}
|
|
9514
|
+
* @brief Get the HLS ABR engine, mode, availability, and capabilities for the current playback session.
|
|
9515
|
+
* @list Api
|
|
9516
|
+
* @returns The current HLS ABR state snapshot.
|
|
9517
|
+
* @notes `engine` is the resolved decision engine, while `configuredEngine` only represents an effective explicit configuration. Use `decisionSource` to choose Levels or Definitions in a quality UI.
|
|
9518
|
+
* @example
|
|
9519
|
+
* ``` javascript
|
|
9520
|
+
* const state = playerSdkIns.getHlsAbrState();
|
|
9521
|
+
* console.log(state.engine, state.mode, state.decisionSource);
|
|
9522
|
+
* ```
|
|
9523
|
+
*/
|
|
9524
|
+
getHlsAbrState(): IHlsAbrState;
|
|
9525
|
+
/** {zh}
|
|
9526
|
+
* @brief 设置当前播放会话的 HLS ABR 自动或手动模式。
|
|
9527
|
+
* @list Api
|
|
9528
|
+
* @param mode ABR 模式。
|
|
9529
|
+
* @notes 设置为 `auto` 时恢复当前已解析出的 ABR 引擎,不保证固定使用 hls.js。设置为 `manual` 本身不选择档位,需配合 `setHlsLevel()` 或 Definition API。
|
|
9530
|
+
* @example
|
|
9531
|
+
* ``` javascript
|
|
9532
|
+
* playerSdkIns.setHlsAbrMode('auto');
|
|
9533
|
+
* ```
|
|
9534
|
+
*/
|
|
9535
|
+
/** {en}
|
|
9536
|
+
* @brief Set automatic or manual HLS ABR mode for the current playback session.
|
|
9537
|
+
* @list Api
|
|
9538
|
+
* @param mode ABR mode.
|
|
9539
|
+
* @notes `auto` restores the resolved ABR engine and does not necessarily select hls.js. `manual` does not select a rendition by itself; use `setHlsLevel()` or a Definition API afterwards.
|
|
9540
|
+
* @example
|
|
9541
|
+
* ``` javascript
|
|
9542
|
+
* playerSdkIns.setHlsAbrMode('auto');
|
|
9543
|
+
* ```
|
|
9544
|
+
*/
|
|
9545
|
+
setHlsAbrMode(mode: HlsAbrMode): void;
|
|
9546
|
+
/** {zh}
|
|
9547
|
+
* @brief 获取当前播放会话已设置的 HLS ABR 上限。
|
|
9548
|
+
* @list Api
|
|
9549
|
+
* @returns 当前上限的副本;未设置时返回 `null`。
|
|
9550
|
+
* @example
|
|
9551
|
+
* ``` javascript
|
|
9552
|
+
* console.log(playerSdkIns.getHlsAbrLimit());
|
|
9553
|
+
* ```
|
|
9554
|
+
*/
|
|
9555
|
+
/** {en}
|
|
9556
|
+
* @brief Get the HLS ABR limit configured for the current playback session.
|
|
9557
|
+
* @list Api
|
|
9558
|
+
* @returns A copy of the current limit, or `null` when no limit is set.
|
|
9559
|
+
* @example
|
|
9560
|
+
* ``` javascript
|
|
9561
|
+
* console.log(playerSdkIns.getHlsAbrLimit());
|
|
9562
|
+
* ```
|
|
9563
|
+
*/
|
|
9564
|
+
getHlsAbrLimit(): IHlsAbrLimit;
|
|
9565
|
+
/** {zh}
|
|
9566
|
+
* @brief 设置或清除当前播放会话的 HLS ABR 上限。
|
|
9567
|
+
* @list Api
|
|
9568
|
+
* @param limit Level、码率或 Definition 上限;传入 `null` 清除上限。
|
|
9569
|
+
* @notes 是否支持某种上限取决于 `getHlsAbrState().capabilities`;无法安全映射时抛出 {@link HlsControlError},原上限保持不变。
|
|
9570
|
+
* @example
|
|
9571
|
+
* ``` javascript
|
|
9572
|
+
* playerSdkIns.setHlsAbrLimit({ type: 'bitrate', maxBitrate: 2500000 });
|
|
9573
|
+
* ```
|
|
9574
|
+
*/
|
|
9575
|
+
/** {en}
|
|
9576
|
+
* @brief Set or clear the HLS ABR limit for the current playback session.
|
|
9577
|
+
* @list Api
|
|
9578
|
+
* @param limit A Level, bitrate, or Definition cap. Pass `null` to clear it.
|
|
9579
|
+
* @notes Supported limit kinds are reported by `getHlsAbrState().capabilities`. A {@link HlsControlError} is thrown when a limit cannot be mapped safely, and the previous limit remains unchanged.
|
|
9580
|
+
* @example
|
|
9581
|
+
* ``` javascript
|
|
9582
|
+
* playerSdkIns.setHlsAbrLimit({ type: 'bitrate', maxBitrate: 2500000 });
|
|
9583
|
+
* ```
|
|
9584
|
+
*/
|
|
9585
|
+
setHlsAbrLimit(limit: IHlsAbrLimit): void;
|
|
8638
9586
|
/** {zh}
|
|
8639
9587
|
* @brief 获取音频轨道列表。HLS 流通过 hls.js 获取,iOS 原生播放通过 HTMLMediaElement.audioTracks 获取。
|
|
8640
9588
|
* @notes 每项包含 `id`、`name`、`lang`、`channels`、`default`、`selected` 字段;轨道数量 ≤ 1 时返回空数组。
|
|
@@ -8910,16 +9858,51 @@ declare class VePlayer {
|
|
|
8910
9858
|
*/
|
|
8911
9859
|
getPlugin(pluginName: string): null | BasePlugin;
|
|
8912
9860
|
/** {zh}
|
|
8913
|
-
* @brief
|
|
8914
|
-
* @
|
|
8915
|
-
* @
|
|
9861
|
+
* @brief 获取当前字幕列表。
|
|
9862
|
+
* @list Api
|
|
9863
|
+
* @returns 当前字幕列表的副本;未注册 `Subtitle` 插件或列表未就绪时返回空数组。
|
|
9864
|
+
* @notes Master M3U8 字幕项的 `source` 为 `hls`,不包含播放地址或底层轨道索引;业务显式配置的非空字幕列表优先。
|
|
9865
|
+
* @example
|
|
9866
|
+
* ``` javascript
|
|
9867
|
+
* const subtitles = playerSdkIns.getSubtitleList();
|
|
9868
|
+
* console.log(subtitles.map(item => item.text));
|
|
9869
|
+
* ```
|
|
9870
|
+
*/
|
|
9871
|
+
/** {en}
|
|
9872
|
+
* @brief Get the current subtitle list.
|
|
9873
|
+
* @list Api
|
|
9874
|
+
* @returns A copy of the current subtitle list, or an empty array when the `Subtitle` plugin is unavailable or the list is not ready.
|
|
9875
|
+
* @notes Master M3U8 subtitle items use `source: 'hls'` and do not expose playback URLs or internal track indexes. A non-empty business-configured subtitle list takes precedence.
|
|
9876
|
+
* @example
|
|
9877
|
+
* ``` javascript
|
|
9878
|
+
* const subtitles = playerSdkIns.getSubtitleList();
|
|
9879
|
+
* console.log(subtitles.map(item => item.text));
|
|
9880
|
+
* ```
|
|
8916
9881
|
*/
|
|
8917
9882
|
getSubtitleList(): ISubTitleItem[];
|
|
8918
9883
|
/** {zh}
|
|
8919
|
-
* @brief
|
|
8920
|
-
* @
|
|
8921
|
-
* @
|
|
8922
|
-
* @
|
|
9884
|
+
* @brief 切换当前字幕轨。
|
|
9885
|
+
* @list Api
|
|
9886
|
+
* @param subtitle 目标字幕的 `id` 或 `language`。优先精确匹配 `id`;仅按语言切换时必须唯一。
|
|
9887
|
+
* @returns 切换成功时 resolve;未找到、语言不唯一、切换超时或播放会话失效时 reject。
|
|
9888
|
+
* @notes hls.js 模式下,Promise 在播放内核确认目标字幕轨后才 resolve。
|
|
9889
|
+
* @example
|
|
9890
|
+
* ``` javascript
|
|
9891
|
+
* const [subtitle] = playerSdkIns.getSubtitleList();
|
|
9892
|
+
* if (subtitle) await playerSdkIns.switchSubtitle({ id: subtitle.id });
|
|
9893
|
+
* ```
|
|
9894
|
+
*/
|
|
9895
|
+
/** {en}
|
|
9896
|
+
* @brief Switch the active subtitle track.
|
|
9897
|
+
* @list Api
|
|
9898
|
+
* @param subtitle Target subtitle `id` or `language`. Exact `id` matching takes precedence; a language-only match must be unique.
|
|
9899
|
+
* @returns Resolves after a successful switch. Rejects when the track is missing, the language is ambiguous, the switch times out, or the playback session expires.
|
|
9900
|
+
* @notes In hls.js mode, the Promise resolves only after the playback engine confirms the target subtitle track.
|
|
9901
|
+
* @example
|
|
9902
|
+
* ``` javascript
|
|
9903
|
+
* const [subtitle] = playerSdkIns.getSubtitleList();
|
|
9904
|
+
* if (subtitle) await playerSdkIns.switchSubtitle({ id: subtitle.id });
|
|
9905
|
+
* ```
|
|
8923
9906
|
*/
|
|
8924
9907
|
switchSubtitle(subtitle: {
|
|
8925
9908
|
id?: string | number;
|
|
@@ -8927,12 +9910,36 @@ declare class VePlayer {
|
|
|
8927
9910
|
}): Promise<void>;
|
|
8928
9911
|
/** {zh}
|
|
8929
9912
|
* @brief 开启字幕展示。恢复上次选中的字幕项;若从未选中过则默认选第一项。需配置 `Subtitle` 插件后调用。
|
|
8930
|
-
* @
|
|
9913
|
+
* @list Api
|
|
9914
|
+
* @example
|
|
9915
|
+
* ``` javascript
|
|
9916
|
+
* playerSdkIns.showSubtitle();
|
|
9917
|
+
* ```
|
|
9918
|
+
*/
|
|
9919
|
+
/** {en}
|
|
9920
|
+
* @brief Show subtitles by restoring the last selected item, or the first item when none has been selected. Requires the `Subtitle` plugin.
|
|
9921
|
+
* @list Api
|
|
9922
|
+
* @example
|
|
9923
|
+
* ``` javascript
|
|
9924
|
+
* playerSdkIns.showSubtitle();
|
|
9925
|
+
* ```
|
|
8931
9926
|
*/
|
|
8932
9927
|
showSubtitle(): void;
|
|
8933
9928
|
/** {zh}
|
|
8934
9929
|
* @brief 关闭字幕展示。字幕数据保留,可通过 `showSubtitle` 重新开启。需配置 `Subtitle` 插件后调用。
|
|
8935
|
-
* @
|
|
9930
|
+
* @list Api
|
|
9931
|
+
* @example
|
|
9932
|
+
* ``` javascript
|
|
9933
|
+
* playerSdkIns.hideSubtitle();
|
|
9934
|
+
* ```
|
|
9935
|
+
*/
|
|
9936
|
+
/** {en}
|
|
9937
|
+
* @brief Hide subtitles while retaining subtitle data so it can be restored with `showSubtitle`. Requires the `Subtitle` plugin.
|
|
9938
|
+
* @list Api
|
|
9939
|
+
* @example
|
|
9940
|
+
* ``` javascript
|
|
9941
|
+
* playerSdkIns.hideSubtitle();
|
|
9942
|
+
* ```
|
|
8936
9943
|
*/
|
|
8937
9944
|
hideSubtitle(): void;
|
|
8938
9945
|
/** {zh}
|
|
@@ -9100,12 +10107,21 @@ export declare class LiveSubtitlesIconPlugin extends Plugin {
|
|
|
9100
10107
|
destroy(): void;
|
|
9101
10108
|
render(): string;
|
|
9102
10109
|
}
|
|
10110
|
+
export declare type NativeSubTitleOptions = {
|
|
10111
|
+
nativeRenderMode?: "system" | "dom";
|
|
10112
|
+
container?: HTMLElement;
|
|
10113
|
+
style?: ISubtitleStyle;
|
|
10114
|
+
playbackSessionId?: string;
|
|
10115
|
+
emit?: (event: string, payload: unknown) => void;
|
|
10116
|
+
createOpaqueId?: () => string;
|
|
10117
|
+
};
|
|
9103
10118
|
declare class NativeSubTitle extends EventEmitter {
|
|
9104
10119
|
_media: any;
|
|
9105
10120
|
_list: any[];
|
|
9106
10121
|
_languages: string;
|
|
9107
10122
|
curIndex: number;
|
|
9108
|
-
|
|
10123
|
+
private _domAdapter?;
|
|
10124
|
+
constructor(media: any, options?: NativeSubTitleOptions);
|
|
9109
10125
|
_init(): void;
|
|
9110
10126
|
_onChange: (e: any) => void;
|
|
9111
10127
|
/**
|
|
@@ -9119,6 +10135,8 @@ declare class NativeSubTitle extends EventEmitter {
|
|
|
9119
10135
|
switch(data: any): Promise<unknown>;
|
|
9120
10136
|
switchOff(): void;
|
|
9121
10137
|
destroy(): void;
|
|
10138
|
+
refresh(): void;
|
|
10139
|
+
setPlaybackSessionId(playbackSessionId: string): void;
|
|
9122
10140
|
}
|
|
9123
10141
|
export interface IPanelItem {
|
|
9124
10142
|
showText: string;
|
|
@@ -9150,6 +10168,7 @@ export declare class Subtitle extends Plugin {
|
|
|
9150
10168
|
};
|
|
9151
10169
|
isShowIcon: boolean;
|
|
9152
10170
|
mode: string;
|
|
10171
|
+
nativeRenderMode: string;
|
|
9153
10172
|
updateMode: string;
|
|
9154
10173
|
};
|
|
9155
10174
|
private _delegates;
|
|
@@ -9162,6 +10181,11 @@ export declare class Subtitle extends Plugin {
|
|
|
9162
10181
|
player: Player & {
|
|
9163
10182
|
_subTitles?: NativeSubTitle | SubTitles;
|
|
9164
10183
|
};
|
|
10184
|
+
private _hideListTimer;
|
|
10185
|
+
private _optionListEnterHandler?;
|
|
10186
|
+
private _optionListLeaveHandler?;
|
|
10187
|
+
private _runtimeSubtitleSource;
|
|
10188
|
+
private _runtimeSubtitleBridge?;
|
|
9165
10189
|
afterCreate(): void;
|
|
9166
10190
|
/**
|
|
9167
10191
|
* @description 初始化原生字幕
|
|
@@ -9173,6 +10197,7 @@ export declare class Subtitle extends Plugin {
|
|
|
9173
10197
|
* @param {number} defaultIndex
|
|
9174
10198
|
*/
|
|
9175
10199
|
_initExtSubTitle(defaultIndex: any): void;
|
|
10200
|
+
private protectExtSubtitleCoreEvents;
|
|
9176
10201
|
_renderList(defaultIndex: any): void;
|
|
9177
10202
|
_onOff: () => void;
|
|
9178
10203
|
_onChange: (data: any) => void;
|
|
@@ -9180,15 +10205,30 @@ export declare class Subtitle extends Plugin {
|
|
|
9180
10205
|
updateCurItem(cIndex: any, subtitle: any): void;
|
|
9181
10206
|
initEvents(): void;
|
|
9182
10207
|
handleButtonChange: (e: any) => void;
|
|
10208
|
+
private runUiSubtitleAction;
|
|
9183
10209
|
onEnter: (e: any) => void;
|
|
9184
10210
|
onLeave: (e: any) => void;
|
|
10211
|
+
private clearPendingListHide;
|
|
10212
|
+
private scheduleListHide;
|
|
10213
|
+
private bindOptionListHoverEvents;
|
|
10214
|
+
private unbindOptionListHoverEvents;
|
|
9185
10215
|
showList(): void;
|
|
9186
10216
|
hideList(): void;
|
|
9187
10217
|
openSubtitle(): Promise<any>;
|
|
9188
|
-
getSubTitleIndex(list:
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
10218
|
+
getSubTitleIndex(list: ISubTitleItem[], subtitle?: Pick<ISubTitleItem, "id" | "language">): number;
|
|
10219
|
+
setRuntimeSubtitleSource(source: "config" | "hls"): void;
|
|
10220
|
+
setRuntimeSubtitleBridge(bridge?: {
|
|
10221
|
+
switchSubtitle: (subtitle: {
|
|
10222
|
+
id?: string | number;
|
|
10223
|
+
language?: string | number;
|
|
10224
|
+
}) => Promise<void>;
|
|
10225
|
+
hide: () => void;
|
|
10226
|
+
show: () => Promise<void>;
|
|
10227
|
+
}): void;
|
|
10228
|
+
replaceRuntimeSubtitleList(list: ISubTitleItem[], isOpen: boolean): void;
|
|
10229
|
+
confirmRuntimeSubtitleSelection(item: ISubTitleItem | null): void;
|
|
10230
|
+
syncRuntimeSubtitleRenderer(runtimeIndex: number): void;
|
|
10231
|
+
clearRuntimeSubtitleView(): void;
|
|
9192
10232
|
registerIcons(): {
|
|
9193
10233
|
vttSubOpen: {
|
|
9194
10234
|
icon: string;
|
|
@@ -9219,6 +10259,7 @@ export declare class Subtitle extends Plugin {
|
|
|
9219
10259
|
"zh-hk": string;
|
|
9220
10260
|
};
|
|
9221
10261
|
};
|
|
10262
|
+
updateLang(lang: string): void;
|
|
9222
10263
|
creatOptionList(): void;
|
|
9223
10264
|
getList(): any;
|
|
9224
10265
|
renderOptionList(): void;
|
|
@@ -9687,285 +10728,55 @@ export declare const Events: {
|
|
|
9687
10728
|
* @brief Triggered when mirror mode is enabled.
|
|
9688
10729
|
*/
|
|
9689
10730
|
MIRROR_CHANGE: string;
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
|
|
9709
|
-
|
|
9710
|
-
|
|
9711
|
-
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
/** {zh}
|
|
9740
|
-
* @brief 画中画模式切换。
|
|
9741
|
-
*/
|
|
9742
|
-
/** {en}
|
|
9743
|
-
* @brief Triggered when mini player (floating) mode changes.
|
|
9744
|
-
*/
|
|
9745
|
-
MINI_STATE_CHANGE: string;
|
|
9746
|
-
/** {zh}
|
|
9747
|
-
* @brief 播放器销毁。
|
|
9748
|
-
*/
|
|
9749
|
-
/** {en}
|
|
9750
|
-
* @brief Triggered when the player is destroyed.
|
|
9751
|
-
*/
|
|
9752
|
-
DESTROY: string;
|
|
9753
|
-
/** {zh}
|
|
9754
|
-
* @brief 播放器重新播放。
|
|
9755
|
-
*/
|
|
9756
|
-
/** {en}
|
|
9757
|
-
* @brief Triggered when replay starts.
|
|
9758
|
-
*/
|
|
9759
|
-
REPLAY: string;
|
|
9760
|
-
/** {zh}
|
|
9761
|
-
* @brief 播放器重试。
|
|
9762
|
-
*/
|
|
9763
|
-
/** {en}
|
|
9764
|
-
* @brief Triggered when the player retries playback.
|
|
9765
|
-
*/
|
|
9766
|
-
RETRY: string;
|
|
9767
|
-
/** {zh}
|
|
9768
|
-
* @brief 清晰度发生变化
|
|
9769
|
-
*/
|
|
9770
|
-
/** {en}
|
|
9771
|
-
* @brief Triggered when the definition (resolution) changes.
|
|
9772
|
-
*/
|
|
9773
|
-
DEFINITION_CHANGE: string;
|
|
9774
|
-
/** {zh}
|
|
9775
|
-
* @hidden
|
|
9776
|
-
*/
|
|
9777
|
-
/** {en}
|
|
9778
|
-
* @hidden
|
|
9779
|
-
*/
|
|
9780
|
-
Before_DEFINITION_CHANGE: string;
|
|
9781
|
-
/** {zh}
|
|
9782
|
-
* @hidden
|
|
9783
|
-
*/
|
|
9784
|
-
/** {en}
|
|
9785
|
-
* @hidden
|
|
9786
|
-
*/
|
|
9787
|
-
AFTER_DEFINITION_CHANGE: string;
|
|
9788
|
-
/** {zh}
|
|
9789
|
-
* @brief 播放器容器尺寸发生变化。
|
|
9790
|
-
*/
|
|
9791
|
-
/** {en}
|
|
9792
|
-
* @brief Triggered when the player container size changes.
|
|
9793
|
-
*/
|
|
9794
|
-
VIDEO_RESIZE: string;
|
|
9795
|
-
/** {zh}
|
|
9796
|
-
* @brief 画中画状态切换。
|
|
9797
|
-
*/
|
|
9798
|
-
/** {en}
|
|
9799
|
-
* @brief Triggered when Picture-in-Picture state changes.
|
|
9800
|
-
*/
|
|
9801
|
-
PIP_CHANGE: string;
|
|
9802
|
-
/** {zh}
|
|
9803
|
-
* @brief 播放器发生旋转。
|
|
9804
|
-
*/
|
|
9805
|
-
/** {en}
|
|
9806
|
-
* @brief Triggered when the player is rotated.
|
|
9807
|
-
*/
|
|
9808
|
-
ROTATE: string;
|
|
9809
|
-
/** {zh}
|
|
9810
|
-
* @brief 播放器内置快捷键事件被触发。
|
|
9811
|
-
*/
|
|
9812
|
-
/** {en}
|
|
9813
|
-
* @brief Triggered when a built-in keyboard shortcut is used.
|
|
9814
|
-
*/
|
|
9815
|
-
SHORTCUT: string;
|
|
9816
|
-
/** {zh}
|
|
9817
|
-
* @deprecated
|
|
9818
|
-
* @brief (已废弃)SEI 信息解析。
|
|
9819
|
-
*/
|
|
9820
|
-
/** {en}
|
|
9821
|
-
* @deprecated
|
|
9822
|
-
* @brief (Deprecated) SEI information parsing.
|
|
9823
|
-
*/
|
|
9824
|
-
SEI_PARSED: string;
|
|
9825
|
-
/** {zh}
|
|
9826
|
-
* @brief 内置插件用户行为触发。所有内置插件用户行为交互都会下发该事件,可用于用户行为埋点。
|
|
9827
|
-
*/
|
|
9828
|
-
/** {en}
|
|
9829
|
-
* @brief Triggered when user actions within plugins are performed. All plugin user actions will trigger this event, which can be used for user behavior tracking.
|
|
9830
|
-
*/
|
|
9831
|
-
USER_ACTION: string;
|
|
9832
|
-
/** {zh}
|
|
9833
|
-
* @brief 自动播放成功时触发。
|
|
9834
|
-
*/
|
|
9835
|
-
/** {en}
|
|
9836
|
-
* @brief Triggered when autoplay succeeds.
|
|
9837
|
-
*/
|
|
9838
|
-
AUTOPLAY_STARTED: string;
|
|
9839
|
-
/** {zh}
|
|
9840
|
-
* @brief 自动播放失败时触发。
|
|
9841
|
-
*/
|
|
9842
|
-
/** {en}
|
|
9843
|
-
* @brief Triggered when autoplay fails.
|
|
9844
|
-
*/
|
|
9845
|
-
AUTOPLAY_PREVENTED: string;
|
|
9846
|
-
/** {zh}
|
|
9847
|
-
* @brief 播放器准备创建。
|
|
9848
|
-
*/
|
|
9849
|
-
READY_CREATE_PLAYER: string;
|
|
9850
|
-
/** {zh}
|
|
9851
|
-
* @brief 播放器完成创建。
|
|
9852
|
-
*/
|
|
9853
|
-
/** {en}
|
|
9854
|
-
* @brief Triggered when player creation completes.
|
|
9855
|
-
*/
|
|
9856
|
-
PLAYER_CREATED_FINISH: string;
|
|
9857
|
-
/** {zh}
|
|
9858
|
-
* @brief createPlayer 性能报告。与 `PLAYER_CREATED_FINISH` 几乎同时触发(略早)。
|
|
9859
|
-
*/
|
|
9860
|
-
/** {en}
|
|
9861
|
-
* @brief createPlayer performance report. Fired almost at the same time as `PLAYER_CREATED_FINISH` (slightly earlier).
|
|
9862
|
-
*/
|
|
9863
|
-
CREATE_PLAYER_PERF: string;
|
|
9864
|
-
/** {zh}
|
|
9865
|
-
* @brief 播放器重建。
|
|
9866
|
-
*/
|
|
9867
|
-
/** {en}
|
|
9868
|
-
* @brief Triggered when the player is rebuilt.
|
|
9869
|
-
*/
|
|
9870
|
-
PLAYER_REBUILD: string;
|
|
9871
|
-
/** {zh}
|
|
9872
|
-
* @brief 硬解不支持时触发。
|
|
9873
|
-
*/
|
|
9874
|
-
/** {en}
|
|
9875
|
-
* @brief Triggered when hardware decoding is not supported.
|
|
9876
|
-
*/
|
|
9877
|
-
NOT_SUPPORT_HARDWARE_DECODER: string;
|
|
9878
|
-
/** {zh}
|
|
9879
|
-
* @brief 软解不支持时触发。
|
|
9880
|
-
*/
|
|
9881
|
-
/** {en}
|
|
9882
|
-
* @brief Triggered when software decoding is not supported.
|
|
9883
|
-
*/
|
|
9884
|
-
NOT_SUPPORT_SOFT_DECODER: string;
|
|
9885
|
-
/** {zh}
|
|
9886
|
-
* @brief `playAuthToken` 过期。
|
|
9887
|
-
*/
|
|
9888
|
-
/** {en}
|
|
9889
|
-
* @brief Triggered when `playAuthToken` expires.
|
|
9890
|
-
*/
|
|
9891
|
-
TOKEN_EXPIRED: string;
|
|
9892
|
-
/** {zh}
|
|
9893
|
-
* @brief UMD 加载失败。
|
|
9894
|
-
*/
|
|
9895
|
-
/** {en}
|
|
9896
|
-
* @brief Triggered when UMD loading fails.
|
|
9897
|
-
*/
|
|
9898
|
-
UMD_LOAD_FAIL: string;
|
|
9899
|
-
/** {zh}
|
|
9900
|
-
* @brief 切换下一个视频。调用 `playNext` 后触发。
|
|
9901
|
-
*/
|
|
9902
|
-
/** {en}
|
|
9903
|
-
* @brief Triggered when switching to the next video, after calling `playNext`.
|
|
9904
|
-
*/
|
|
9905
|
-
PLAYNEXT: string;
|
|
9906
|
-
/** {zh}
|
|
9907
|
-
* @brief 视频地址为空。
|
|
9908
|
-
*/
|
|
9909
|
-
/** {en}
|
|
9910
|
-
* @brief Triggered when the video URL is empty.
|
|
9911
|
-
*/
|
|
9912
|
-
URL_NULL: string;
|
|
9913
|
-
/** {zh}
|
|
9914
|
-
* @brief 鼠标移出。
|
|
9915
|
-
*/
|
|
9916
|
-
/** {en}
|
|
9917
|
-
* @brief Triggered when the mouse leaves the player.
|
|
9918
|
-
*/
|
|
9919
|
-
LEAVE_PLAYER: string;
|
|
9920
|
-
/** {zh}
|
|
9921
|
-
* @brief 鼠标移入。
|
|
9922
|
-
*/
|
|
9923
|
-
/** {en}
|
|
9924
|
-
* @brief Triggered when the mouse enters the player.
|
|
9925
|
-
*/
|
|
9926
|
-
ENTER_PLAYER: string;
|
|
9927
|
-
/** {zh}
|
|
9928
|
-
* @brief 播放器状态重置。
|
|
9929
|
-
*/
|
|
9930
|
-
/** {en}
|
|
9931
|
-
* @brief Triggered when the player state is reset.
|
|
9932
|
-
*/
|
|
9933
|
-
RESET: string;
|
|
9934
|
-
/** {zh}
|
|
9935
|
-
* @brief `<source>` 加载错误,表示 `<source>` 不支持或播放失败。
|
|
9936
|
-
*/
|
|
9937
|
-
/** {en}
|
|
9938
|
-
* @brief Triggered when a `<source>` fails to load (unsupported or playback failed).
|
|
9939
|
-
*/
|
|
9940
|
-
SOURCE_ERROR: string;
|
|
9941
|
-
/** {zh}
|
|
9942
|
-
* @brief `<source>` 加载成功。
|
|
9943
|
-
*/
|
|
9944
|
-
/** {en}
|
|
9945
|
-
* @brief Triggered when a `<source>` loads successfully.
|
|
9946
|
-
*/
|
|
9947
|
-
SOURCE_SUCCESS: string;
|
|
9948
|
-
/** {zh}
|
|
9949
|
-
* @brief license 提醒
|
|
9950
|
-
*/
|
|
9951
|
-
/** {en}
|
|
9952
|
-
* @brief License status warning.
|
|
9953
|
-
*/
|
|
9954
|
-
LICENSE_STATUS_WARNING: string;
|
|
9955
|
-
/** {zh}
|
|
9956
|
-
* @brief HLS 音频轨道列表更新时触发。`data.audioTracks` 为完整轨道数组。
|
|
9957
|
-
*/
|
|
9958
|
-
/** {en}
|
|
9959
|
-
* @brief Triggered when the HLS audio track list updates. `data.audioTracks` is the full track array.
|
|
9960
|
-
*/
|
|
9961
|
-
AUDIO_TRACKS_UPDATED: string;
|
|
9962
|
-
/** {zh}
|
|
9963
|
-
* @brief 音频轨道切换完成时触发。`data.id` 为新轨道 id,`data.audioTrack` 为完整轨道对象。
|
|
9964
|
-
*/
|
|
9965
|
-
/** {en}
|
|
9966
|
-
* @brief Triggered when audio track switching completes. `data.id` is the new track id; `data.audioTrack` is the full track object.
|
|
9967
|
-
*/
|
|
9968
|
-
AUDIO_TRACK_CHANGE: string;
|
|
10731
|
+
READY: "ready";
|
|
10732
|
+
COMPLETE: "complete";
|
|
10733
|
+
URL_CHANGE: "urlchange";
|
|
10734
|
+
PLAYER_FOCUS: "focus";
|
|
10735
|
+
PLAYER_BLUR: "blur";
|
|
10736
|
+
FULLSCREEN_CHANGE: "fullscreen_change";
|
|
10737
|
+
CSS_FULLSCREEN_CHANGE: "cssFullscreen_change";
|
|
10738
|
+
MINI_STATE_CHANGE: "mini_state_change";
|
|
10739
|
+
DESTROY: "destroy";
|
|
10740
|
+
REPLAY: "replay";
|
|
10741
|
+
RETRY: "retry";
|
|
10742
|
+
DEFINITION_CHANGE: "definition_change";
|
|
10743
|
+
Before_DEFINITION_CHANGE: "before_definition_change";
|
|
10744
|
+
AFTER_DEFINITION_CHANGE: "after_definition_change";
|
|
10745
|
+
VIDEO_RESIZE: "video_resize";
|
|
10746
|
+
PIP_CHANGE: "pip_change";
|
|
10747
|
+
ROTATE: "rotate";
|
|
10748
|
+
SHORTCUT: "shortcut";
|
|
10749
|
+
SEI_PARSED: "SEI_PARSED";
|
|
10750
|
+
USER_ACTION: "user_action";
|
|
10751
|
+
AUTOPLAY_STARTED: "autoplay_started";
|
|
10752
|
+
AUTOPLAY_PREVENTED: "autoplay_was_prevented";
|
|
10753
|
+
READY_CREATE_PLAYER: "ready_create_player";
|
|
10754
|
+
PLAYER_CREATED_FINISH: "player_create_finish";
|
|
10755
|
+
CREATE_PLAYER_PERF: "create_player_perf";
|
|
10756
|
+
PLAYER_REBUILD: "player_rebuild";
|
|
10757
|
+
NOT_SUPPORT_HARDWARE_DECODER: "not_support_hardware_decoder";
|
|
10758
|
+
NOT_SUPPORT_SOFT_DECODER: "not_support_soft_decoder";
|
|
10759
|
+
TOKEN_EXPIRED: "playAuthToken_expired";
|
|
10760
|
+
UMD_LOAD_FAIL: "umd_load_fail";
|
|
10761
|
+
PLAYNEXT: "playnext";
|
|
10762
|
+
URL_NULL: "urlNull";
|
|
10763
|
+
LEAVE_PLAYER: "leaveplayer";
|
|
10764
|
+
ENTER_PLAYER: "enterplayer";
|
|
10765
|
+
RESET: "reset";
|
|
10766
|
+
SOURCE_ERROR: "source_error";
|
|
10767
|
+
SOURCE_SUCCESS: "source_success";
|
|
10768
|
+
LICENSE_STATUS_WARNING: "license_status_warning";
|
|
10769
|
+
AUDIO_TRACKS_UPDATED: "audio_tracks_updated";
|
|
10770
|
+
AUDIO_TRACK_CHANGE: "audio_track_change";
|
|
10771
|
+
HLS_LEVELS_UPDATED: "hls_levels_updated";
|
|
10772
|
+
HLS_LEVEL_SWITCHING: "hls_level_switching";
|
|
10773
|
+
HLS_LEVEL_SWITCHED: "hls_level_switched";
|
|
10774
|
+
HLS_ABR_ENGINE_RESOLVED: "hls_abr_engine_resolved";
|
|
10775
|
+
HLS_ABR_STATE_CHANGE: "hls_abr_state_change";
|
|
10776
|
+
HLS_ABR_LIMIT_CHANGE: "hls_abr_limit_change";
|
|
10777
|
+
HLS_SUBTITLE_TRACKS_UPDATED: "hls_subtitle_tracks_updated";
|
|
10778
|
+
HLS_SUBTITLE_TRACK_SWITCHING: "hls_subtitle_track_switching";
|
|
10779
|
+
HLS_SUBTITLE_TRACK_SWITCHED: "hls_subtitle_track_switched";
|
|
9969
10780
|
/** {zh}
|
|
9970
10781
|
* @brief 在播放被终止时触发。例如当播放中的视频重新开始播放。
|
|
9971
10782
|
*/
|
|
@@ -10138,126 +10949,126 @@ export declare const Event: {
|
|
|
10138
10949
|
/** {en}
|
|
10139
10950
|
* @brief Triggered when the player instance is created.
|
|
10140
10951
|
*/
|
|
10141
|
-
READY:
|
|
10952
|
+
readonly READY: "ready";
|
|
10142
10953
|
/** {zh}
|
|
10143
10954
|
* @brief 播放器创建 `video` 完成时触发,表示可以开始播放。
|
|
10144
10955
|
*/
|
|
10145
10956
|
/** {en}
|
|
10146
10957
|
* @brief Triggered when the player has created the `video` element and playback can start.
|
|
10147
10958
|
*/
|
|
10148
|
-
COMPLETE:
|
|
10959
|
+
readonly COMPLETE: "complete";
|
|
10149
10960
|
/** {zh}
|
|
10150
10961
|
* @brief 播放资源发生变化。
|
|
10151
10962
|
*/
|
|
10152
10963
|
/** {en}
|
|
10153
10964
|
* @brief Triggered when the playback resource changes.
|
|
10154
10965
|
*/
|
|
10155
|
-
URL_CHANGE:
|
|
10966
|
+
readonly URL_CHANGE: "urlchange";
|
|
10156
10967
|
/** {zh}
|
|
10157
10968
|
* @brief 播放器聚焦,同时会展示 Control 栏控件,包含播放按钮、进度条等。
|
|
10158
10969
|
*/
|
|
10159
10970
|
/** {en}
|
|
10160
10971
|
* @brief Triggered when the player gains focus; the control bar is shown.
|
|
10161
10972
|
*/
|
|
10162
|
-
PLAYER_FOCUS:
|
|
10973
|
+
readonly PLAYER_FOCUS: "focus";
|
|
10163
10974
|
/** {zh}
|
|
10164
10975
|
* @brief 播放器失焦,同时会隐藏 Control 栏控件,包含播放按钮、进度条等。
|
|
10165
10976
|
*/
|
|
10166
10977
|
/** {en}
|
|
10167
10978
|
* @brief Triggered when the player loses focus; the control bar is hidden.
|
|
10168
10979
|
*/
|
|
10169
|
-
PLAYER_BLUR:
|
|
10980
|
+
readonly PLAYER_BLUR: "blur";
|
|
10170
10981
|
/** {zh}
|
|
10171
10982
|
* @brief 系统全屏状态切换。
|
|
10172
10983
|
*/
|
|
10173
10984
|
/** {en}
|
|
10174
10985
|
* @brief Triggered when native fullscreen state changes.
|
|
10175
10986
|
*/
|
|
10176
|
-
FULLSCREEN_CHANGE:
|
|
10987
|
+
readonly FULLSCREEN_CHANGE: "fullscreen_change";
|
|
10177
10988
|
/** {zh}
|
|
10178
10989
|
* @brief 网页全屏状态切换。
|
|
10179
10990
|
*/
|
|
10180
10991
|
/** {en}
|
|
10181
10992
|
* @brief Triggered when CSS fullscreen state changes.
|
|
10182
10993
|
*/
|
|
10183
|
-
CSS_FULLSCREEN_CHANGE:
|
|
10994
|
+
readonly CSS_FULLSCREEN_CHANGE: "cssFullscreen_change";
|
|
10184
10995
|
/** {zh}
|
|
10185
10996
|
* @brief 画中画模式切换。
|
|
10186
10997
|
*/
|
|
10187
10998
|
/** {en}
|
|
10188
10999
|
* @brief Triggered when mini player (floating) mode changes.
|
|
10189
11000
|
*/
|
|
10190
|
-
MINI_STATE_CHANGE:
|
|
11001
|
+
readonly MINI_STATE_CHANGE: "mini_state_change";
|
|
10191
11002
|
/** {zh}
|
|
10192
11003
|
* @brief 播放器销毁。
|
|
10193
11004
|
*/
|
|
10194
11005
|
/** {en}
|
|
10195
11006
|
* @brief Triggered when the player is destroyed.
|
|
10196
11007
|
*/
|
|
10197
|
-
DESTROY:
|
|
11008
|
+
readonly DESTROY: "destroy";
|
|
10198
11009
|
/** {zh}
|
|
10199
11010
|
* @brief 播放器重新播放。
|
|
10200
11011
|
*/
|
|
10201
11012
|
/** {en}
|
|
10202
11013
|
* @brief Triggered when replay starts.
|
|
10203
11014
|
*/
|
|
10204
|
-
REPLAY:
|
|
11015
|
+
readonly REPLAY: "replay";
|
|
10205
11016
|
/** {zh}
|
|
10206
11017
|
* @brief 播放器重试。
|
|
10207
11018
|
*/
|
|
10208
11019
|
/** {en}
|
|
10209
11020
|
* @brief Triggered when the player retries playback.
|
|
10210
11021
|
*/
|
|
10211
|
-
RETRY:
|
|
11022
|
+
readonly RETRY: "retry";
|
|
10212
11023
|
/** {zh}
|
|
10213
11024
|
* @brief 清晰度发生变化
|
|
10214
11025
|
*/
|
|
10215
11026
|
/** {en}
|
|
10216
11027
|
* @brief Triggered when the definition (resolution) changes.
|
|
10217
11028
|
*/
|
|
10218
|
-
DEFINITION_CHANGE:
|
|
11029
|
+
readonly DEFINITION_CHANGE: "definition_change";
|
|
10219
11030
|
/** {zh}
|
|
10220
11031
|
* @hidden
|
|
10221
11032
|
*/
|
|
10222
11033
|
/** {en}
|
|
10223
11034
|
* @hidden
|
|
10224
11035
|
*/
|
|
10225
|
-
Before_DEFINITION_CHANGE:
|
|
11036
|
+
readonly Before_DEFINITION_CHANGE: "before_definition_change";
|
|
10226
11037
|
/** {zh}
|
|
10227
11038
|
* @hidden
|
|
10228
11039
|
*/
|
|
10229
11040
|
/** {en}
|
|
10230
11041
|
* @hidden
|
|
10231
11042
|
*/
|
|
10232
|
-
AFTER_DEFINITION_CHANGE:
|
|
11043
|
+
readonly AFTER_DEFINITION_CHANGE: "after_definition_change";
|
|
10233
11044
|
/** {zh}
|
|
10234
11045
|
* @brief 播放器容器尺寸发生变化。
|
|
10235
11046
|
*/
|
|
10236
11047
|
/** {en}
|
|
10237
11048
|
* @brief Triggered when the player container size changes.
|
|
10238
11049
|
*/
|
|
10239
|
-
VIDEO_RESIZE:
|
|
11050
|
+
readonly VIDEO_RESIZE: "video_resize";
|
|
10240
11051
|
/** {zh}
|
|
10241
11052
|
* @brief 画中画状态切换。
|
|
10242
11053
|
*/
|
|
10243
11054
|
/** {en}
|
|
10244
11055
|
* @brief Triggered when Picture-in-Picture state changes.
|
|
10245
11056
|
*/
|
|
10246
|
-
PIP_CHANGE:
|
|
11057
|
+
readonly PIP_CHANGE: "pip_change";
|
|
10247
11058
|
/** {zh}
|
|
10248
11059
|
* @brief 播放器发生旋转。
|
|
10249
11060
|
*/
|
|
10250
11061
|
/** {en}
|
|
10251
11062
|
* @brief Triggered when the player is rotated.
|
|
10252
11063
|
*/
|
|
10253
|
-
ROTATE:
|
|
11064
|
+
readonly ROTATE: "rotate";
|
|
10254
11065
|
/** {zh}
|
|
10255
11066
|
* @brief 播放器内置快捷键事件被触发。
|
|
10256
11067
|
*/
|
|
10257
11068
|
/** {en}
|
|
10258
11069
|
* @brief Triggered when a built-in keyboard shortcut is used.
|
|
10259
11070
|
*/
|
|
10260
|
-
SHORTCUT:
|
|
11071
|
+
readonly SHORTCUT: "shortcut";
|
|
10261
11072
|
/** {zh}
|
|
10262
11073
|
* @deprecated
|
|
10263
11074
|
* @brief (已废弃)SEI 信息解析。
|
|
@@ -10266,151 +11077,214 @@ export declare const Event: {
|
|
|
10266
11077
|
* @deprecated
|
|
10267
11078
|
* @brief (Deprecated) SEI information parsing.
|
|
10268
11079
|
*/
|
|
10269
|
-
SEI_PARSED:
|
|
11080
|
+
readonly SEI_PARSED: "SEI_PARSED";
|
|
10270
11081
|
/** {zh}
|
|
10271
11082
|
* @brief 内置插件用户行为触发。所有内置插件用户行为交互都会下发该事件,可用于用户行为埋点。
|
|
10272
11083
|
*/
|
|
10273
11084
|
/** {en}
|
|
10274
11085
|
* @brief Triggered when user actions within plugins are performed. All plugin user actions will trigger this event, which can be used for user behavior tracking.
|
|
10275
11086
|
*/
|
|
10276
|
-
USER_ACTION:
|
|
11087
|
+
readonly USER_ACTION: "user_action";
|
|
10277
11088
|
/** {zh}
|
|
10278
11089
|
* @brief 自动播放成功时触发。
|
|
10279
11090
|
*/
|
|
10280
11091
|
/** {en}
|
|
10281
11092
|
* @brief Triggered when autoplay succeeds.
|
|
10282
11093
|
*/
|
|
10283
|
-
AUTOPLAY_STARTED:
|
|
11094
|
+
readonly AUTOPLAY_STARTED: "autoplay_started";
|
|
10284
11095
|
/** {zh}
|
|
10285
11096
|
* @brief 自动播放失败时触发。
|
|
10286
11097
|
*/
|
|
10287
11098
|
/** {en}
|
|
10288
11099
|
* @brief Triggered when autoplay fails.
|
|
10289
11100
|
*/
|
|
10290
|
-
AUTOPLAY_PREVENTED:
|
|
11101
|
+
readonly AUTOPLAY_PREVENTED: "autoplay_was_prevented";
|
|
10291
11102
|
/** {zh}
|
|
10292
11103
|
* @brief 播放器准备创建。
|
|
10293
11104
|
*/
|
|
10294
|
-
READY_CREATE_PLAYER:
|
|
11105
|
+
readonly READY_CREATE_PLAYER: "ready_create_player";
|
|
10295
11106
|
/** {zh}
|
|
10296
11107
|
* @brief 播放器完成创建。
|
|
10297
11108
|
*/
|
|
10298
11109
|
/** {en}
|
|
10299
11110
|
* @brief Triggered when player creation completes.
|
|
10300
11111
|
*/
|
|
10301
|
-
PLAYER_CREATED_FINISH:
|
|
11112
|
+
readonly PLAYER_CREATED_FINISH: "player_create_finish";
|
|
10302
11113
|
/** {zh}
|
|
10303
11114
|
* @brief createPlayer 性能报告。与 `PLAYER_CREATED_FINISH` 几乎同时触发(略早)。
|
|
10304
11115
|
*/
|
|
10305
11116
|
/** {en}
|
|
10306
11117
|
* @brief createPlayer performance report. Fired almost at the same time as `PLAYER_CREATED_FINISH` (slightly earlier).
|
|
10307
11118
|
*/
|
|
10308
|
-
CREATE_PLAYER_PERF:
|
|
11119
|
+
readonly CREATE_PLAYER_PERF: "create_player_perf";
|
|
10309
11120
|
/** {zh}
|
|
10310
11121
|
* @brief 播放器重建。
|
|
10311
11122
|
*/
|
|
10312
11123
|
/** {en}
|
|
10313
11124
|
* @brief Triggered when the player is rebuilt.
|
|
10314
11125
|
*/
|
|
10315
|
-
PLAYER_REBUILD:
|
|
11126
|
+
readonly PLAYER_REBUILD: "player_rebuild";
|
|
10316
11127
|
/** {zh}
|
|
10317
11128
|
* @brief 硬解不支持时触发。
|
|
10318
11129
|
*/
|
|
10319
11130
|
/** {en}
|
|
10320
11131
|
* @brief Triggered when hardware decoding is not supported.
|
|
10321
11132
|
*/
|
|
10322
|
-
NOT_SUPPORT_HARDWARE_DECODER:
|
|
11133
|
+
readonly NOT_SUPPORT_HARDWARE_DECODER: "not_support_hardware_decoder";
|
|
10323
11134
|
/** {zh}
|
|
10324
11135
|
* @brief 软解不支持时触发。
|
|
10325
11136
|
*/
|
|
10326
11137
|
/** {en}
|
|
10327
11138
|
* @brief Triggered when software decoding is not supported.
|
|
10328
11139
|
*/
|
|
10329
|
-
NOT_SUPPORT_SOFT_DECODER:
|
|
11140
|
+
readonly NOT_SUPPORT_SOFT_DECODER: "not_support_soft_decoder";
|
|
10330
11141
|
/** {zh}
|
|
10331
11142
|
* @brief `playAuthToken` 过期。
|
|
10332
11143
|
*/
|
|
10333
11144
|
/** {en}
|
|
10334
11145
|
* @brief Triggered when `playAuthToken` expires.
|
|
10335
11146
|
*/
|
|
10336
|
-
TOKEN_EXPIRED:
|
|
11147
|
+
readonly TOKEN_EXPIRED: "playAuthToken_expired";
|
|
10337
11148
|
/** {zh}
|
|
10338
11149
|
* @brief UMD 加载失败。
|
|
10339
11150
|
*/
|
|
10340
11151
|
/** {en}
|
|
10341
11152
|
* @brief Triggered when UMD loading fails.
|
|
10342
11153
|
*/
|
|
10343
|
-
UMD_LOAD_FAIL:
|
|
11154
|
+
readonly UMD_LOAD_FAIL: "umd_load_fail";
|
|
10344
11155
|
/** {zh}
|
|
10345
11156
|
* @brief 切换下一个视频。调用 `playNext` 后触发。
|
|
10346
11157
|
*/
|
|
10347
11158
|
/** {en}
|
|
10348
11159
|
* @brief Triggered when switching to the next video, after calling `playNext`.
|
|
10349
11160
|
*/
|
|
10350
|
-
PLAYNEXT:
|
|
11161
|
+
readonly PLAYNEXT: "playnext";
|
|
10351
11162
|
/** {zh}
|
|
10352
11163
|
* @brief 视频地址为空。
|
|
10353
11164
|
*/
|
|
10354
11165
|
/** {en}
|
|
10355
11166
|
* @brief Triggered when the video URL is empty.
|
|
10356
11167
|
*/
|
|
10357
|
-
URL_NULL:
|
|
11168
|
+
readonly URL_NULL: "urlNull";
|
|
10358
11169
|
/** {zh}
|
|
10359
11170
|
* @brief 鼠标移出。
|
|
10360
11171
|
*/
|
|
10361
11172
|
/** {en}
|
|
10362
11173
|
* @brief Triggered when the mouse leaves the player.
|
|
10363
11174
|
*/
|
|
10364
|
-
LEAVE_PLAYER:
|
|
11175
|
+
readonly LEAVE_PLAYER: "leaveplayer";
|
|
10365
11176
|
/** {zh}
|
|
10366
11177
|
* @brief 鼠标移入。
|
|
10367
11178
|
*/
|
|
10368
11179
|
/** {en}
|
|
10369
11180
|
* @brief Triggered when the mouse enters the player.
|
|
10370
11181
|
*/
|
|
10371
|
-
ENTER_PLAYER:
|
|
11182
|
+
readonly ENTER_PLAYER: "enterplayer";
|
|
10372
11183
|
/** {zh}
|
|
10373
11184
|
* @brief 播放器状态重置。
|
|
10374
11185
|
*/
|
|
10375
11186
|
/** {en}
|
|
10376
11187
|
* @brief Triggered when the player state is reset.
|
|
10377
11188
|
*/
|
|
10378
|
-
RESET:
|
|
11189
|
+
readonly RESET: "reset";
|
|
10379
11190
|
/** {zh}
|
|
10380
11191
|
* @brief `<source>` 加载错误,表示 `<source>` 不支持或播放失败。
|
|
10381
11192
|
*/
|
|
10382
11193
|
/** {en}
|
|
10383
11194
|
* @brief Triggered when a `<source>` fails to load (unsupported or playback failed).
|
|
10384
11195
|
*/
|
|
10385
|
-
SOURCE_ERROR:
|
|
11196
|
+
readonly SOURCE_ERROR: "source_error";
|
|
10386
11197
|
/** {zh}
|
|
10387
11198
|
* @brief `<source>` 加载成功。
|
|
10388
11199
|
*/
|
|
10389
11200
|
/** {en}
|
|
10390
11201
|
* @brief Triggered when a `<source>` loads successfully.
|
|
10391
11202
|
*/
|
|
10392
|
-
SOURCE_SUCCESS:
|
|
11203
|
+
readonly SOURCE_SUCCESS: "source_success";
|
|
10393
11204
|
/** {zh}
|
|
10394
11205
|
* @brief license 提醒
|
|
10395
11206
|
*/
|
|
10396
11207
|
/** {en}
|
|
10397
11208
|
* @brief License status warning.
|
|
10398
11209
|
*/
|
|
10399
|
-
LICENSE_STATUS_WARNING:
|
|
11210
|
+
readonly LICENSE_STATUS_WARNING: "license_status_warning";
|
|
10400
11211
|
/** {zh}
|
|
10401
11212
|
* @brief HLS 音频轨道列表更新时触发。`data.audioTracks` 为完整轨道数组。
|
|
10402
11213
|
*/
|
|
10403
11214
|
/** {en}
|
|
10404
11215
|
* @brief Triggered when the HLS audio track list updates. `data.audioTracks` is the full track array.
|
|
10405
11216
|
*/
|
|
10406
|
-
AUDIO_TRACKS_UPDATED:
|
|
11217
|
+
readonly AUDIO_TRACKS_UPDATED: "audio_tracks_updated";
|
|
10407
11218
|
/** {zh}
|
|
10408
11219
|
* @brief 音频轨道切换完成时触发。`data.id` 为新轨道 id,`data.audioTrack` 为完整轨道对象。
|
|
10409
11220
|
*/
|
|
10410
11221
|
/** {en}
|
|
10411
11222
|
* @brief Triggered when audio track switching completes. `data.id` is the new track id; `data.audioTrack` is the full track object.
|
|
10412
11223
|
*/
|
|
10413
|
-
AUDIO_TRACK_CHANGE:
|
|
11224
|
+
readonly AUDIO_TRACK_CHANGE: "audio_track_change";
|
|
11225
|
+
/** {zh}
|
|
11226
|
+
* @brief 当前播放会话的 HLS Level 列表或状态更新。
|
|
11227
|
+
*/
|
|
11228
|
+
/** {en}
|
|
11229
|
+
* @brief Triggered when the HLS Level list or state updates for the current playback session.
|
|
11230
|
+
*/
|
|
11231
|
+
readonly HLS_LEVELS_UPDATED: "hls_levels_updated";
|
|
11232
|
+
/** {zh}
|
|
11233
|
+
* @brief HLS Level 切换请求已提交给播放内核;不表示画面已经切换。
|
|
11234
|
+
*/
|
|
11235
|
+
/** {en}
|
|
11236
|
+
* @brief Triggered after an HLS Level switch is submitted to the playback engine; the rendered Level may not have changed yet.
|
|
11237
|
+
*/
|
|
11238
|
+
readonly HLS_LEVEL_SWITCHING: "hls_level_switching";
|
|
11239
|
+
/** {zh}
|
|
11240
|
+
* @brief HLS Level 已实际切换。
|
|
11241
|
+
*/
|
|
11242
|
+
/** {en}
|
|
11243
|
+
* @brief Triggered after the active HLS Level has actually switched.
|
|
11244
|
+
*/
|
|
11245
|
+
readonly HLS_LEVEL_SWITCHED: "hls_level_switched";
|
|
11246
|
+
/** {zh}
|
|
11247
|
+
* @brief 当前播放会话的 HLS ABR 决策引擎解析完成。
|
|
11248
|
+
*/
|
|
11249
|
+
/** {en}
|
|
11250
|
+
* @brief Triggered after the HLS ABR decision engine is resolved for the current playback session.
|
|
11251
|
+
*/
|
|
11252
|
+
readonly HLS_ABR_ENGINE_RESOLVED: "hls_abr_engine_resolved";
|
|
11253
|
+
/** {zh}
|
|
11254
|
+
* @brief HLS ABR 的可用性、自动/手动模式或激活状态发生变化。
|
|
11255
|
+
*/
|
|
11256
|
+
/** {en}
|
|
11257
|
+
* @brief Triggered when HLS ABR availability, auto/manual mode, or active state changes.
|
|
11258
|
+
*/
|
|
11259
|
+
readonly HLS_ABR_STATE_CHANGE: "hls_abr_state_change";
|
|
11260
|
+
/** {zh}
|
|
11261
|
+
* @brief HLS ABR 上限发生变化。
|
|
11262
|
+
*/
|
|
11263
|
+
/** {en}
|
|
11264
|
+
* @brief Triggered when the HLS ABR cap changes.
|
|
11265
|
+
*/
|
|
11266
|
+
readonly HLS_ABR_LIMIT_CHANGE: "hls_abr_limit_change";
|
|
11267
|
+
/** {zh}
|
|
11268
|
+
* @brief 当前播放会话从 Master M3U8 或原生 TextTrack 获得的字幕列表更新。
|
|
11269
|
+
*/
|
|
11270
|
+
/** {en}
|
|
11271
|
+
* @brief Triggered when the subtitle list sourced from a Master M3U8 or native TextTracks updates for the current playback session.
|
|
11272
|
+
*/
|
|
11273
|
+
readonly HLS_SUBTITLE_TRACKS_UPDATED: "hls_subtitle_tracks_updated";
|
|
11274
|
+
/** {zh}
|
|
11275
|
+
* @brief HLS 字幕轨切换请求已提交;不表示字幕轨已经生效。
|
|
11276
|
+
*/
|
|
11277
|
+
/** {en}
|
|
11278
|
+
* @brief Triggered after an HLS subtitle-track switch is submitted; the track may not be active yet.
|
|
11279
|
+
*/
|
|
11280
|
+
readonly HLS_SUBTITLE_TRACK_SWITCHING: "hls_subtitle_track_switching";
|
|
11281
|
+
/** {zh}
|
|
11282
|
+
* @brief HLS 字幕轨切换已经生效。
|
|
11283
|
+
*/
|
|
11284
|
+
/** {en}
|
|
11285
|
+
* @brief Triggered after an HLS subtitle-track switch takes effect.
|
|
11286
|
+
*/
|
|
11287
|
+
readonly HLS_SUBTITLE_TRACK_SWITCHED: "hls_subtitle_track_switched";
|
|
10414
11288
|
};
|
|
10415
11289
|
PluginEvents: {
|
|
10416
11290
|
/** {zh}
|