@volcengine/veplayer 1.19.0-rc.0 → 1.19.0-rc.10

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 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?: string;
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?: string | number;
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;
@@ -3415,6 +3606,465 @@ export interface IVideoInfo {
3415
3606
  Data: IGetPlayInfoRes;
3416
3607
  };
3417
3608
  }
3609
+ /** {zh}
3610
+ * @brief VePlayer 实际使用的 HLS 播放内核。
3611
+ * @detail ref
3612
+ */
3613
+ /** {en}
3614
+ * @brief The HLS playback engine actually used by VePlayer.
3615
+ * @detail ref
3616
+ */
3617
+ export declare type HlsPlaybackEngine = "hlsjs" | "veplayer-hls" | "native" | "none";
3618
+ /** {zh}
3619
+ * @brief HLS 自动码率决策引擎配置值。
3620
+ * @detail ref
3621
+ */
3622
+ /** {en}
3623
+ * @brief Configurable HLS adaptive-bitrate decision engine.
3624
+ * @detail ref
3625
+ */
3626
+ export declare type HlsAbrEngine = "hlsjs" | "veplayer";
3627
+ /** {zh}
3628
+ * @brief 当前播放会话最终解析出的自动码率决策引擎。
3629
+ * @detail ref
3630
+ */
3631
+ /** {en}
3632
+ * @brief Adaptive-bitrate decision engine resolved for the current playback session.
3633
+ * @detail ref
3634
+ */
3635
+ export declare type ResolvedAbrEngine = HlsAbrEngine | "native" | "none";
3636
+ /** {zh}
3637
+ * @brief HLS 自动码率控制模式。
3638
+ * @detail ref
3639
+ */
3640
+ /** {en}
3641
+ * @brief HLS adaptive-bitrate control mode.
3642
+ * @detail ref
3643
+ */
3644
+ export declare type HlsAbrMode = "auto" | "manual";
3645
+ /** {zh}
3646
+ * @brief 当前播放会话无法使用 HLS ABR 的原因。
3647
+ * @detail ref
3648
+ */
3649
+ /** {en}
3650
+ * @brief Reason why HLS ABR is unavailable for the current playback session.
3651
+ * @detail ref
3652
+ */
3653
+ 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";
3654
+ /** {zh}
3655
+ * @brief 当前 HLS 播放会话支持的 ABR 能力。
3656
+ * @detail ref
3657
+ */
3658
+ /** {en}
3659
+ * @brief ABR capabilities supported by the current HLS playback session.
3660
+ * @detail ref
3661
+ */
3662
+ export interface IHlsAbrCapabilities {
3663
+ /** {zh} @brief 是否可读取 HLS Level 列表。 */
3664
+ /** {en} @brief Whether the HLS Level list is available. */
3665
+ levelList: boolean;
3666
+ /** {zh} @brief 是否支持手动切换 HLS Level。 */
3667
+ /** {en} @brief Whether manual HLS Level switching is supported. */
3668
+ manualLevelSwitch: boolean;
3669
+ /** {zh} @brief 是否支持恢复当前 ABR 引擎的自动模式。 */
3670
+ /** {en} @brief Whether automatic mode can be restored for the resolved ABR engine. */
3671
+ restoreAuto: boolean;
3672
+ /** {zh} @brief 是否支持按 Level 设置自动码率上限。 */
3673
+ /** {en} @brief Whether an automatic bitrate cap can be set by Level. */
3674
+ levelCap: boolean;
3675
+ /** {zh} @brief 是否支持按码率设置自动码率上限。 */
3676
+ /** {en} @brief Whether an automatic bitrate cap can be set by bitrate. */
3677
+ bitrateCap: boolean;
3678
+ /** {zh} @brief 是否支持按 VePlayer 清晰度设置自动码率上限。 */
3679
+ /** {en} @brief Whether an automatic bitrate cap can be set by VePlayer definition. */
3680
+ definitionCap: boolean;
3681
+ }
3682
+ /** {zh}
3683
+ * @brief 当前播放会话的 HLS ABR 状态快照。
3684
+ * @detail ref
3685
+ */
3686
+ /** {en}
3687
+ * @brief HLS ABR state snapshot for the current playback session.
3688
+ * @detail ref
3689
+ */
3690
+ export interface IHlsAbrState {
3691
+ /** {zh} @brief 播放会话 ID,用于识别过期状态和事件。 */
3692
+ /** {en} @brief Playback session ID used to reject stale state and events. */
3693
+ playbackSessionId: string;
3694
+ /** {zh} @brief VePlayer 实际使用的 HLS 播放内核。 */
3695
+ /** {en} @brief HLS playback engine actually used by VePlayer. */
3696
+ playbackEngine: HlsPlaybackEngine;
3697
+ /** {zh} @brief 业务显式配置的 ABR 引擎;未配置时为 `null`。 */
3698
+ /** {en} @brief Explicitly configured ABR engine, or `null` when omitted. */
3699
+ configuredEngine: HlsAbrEngine | null;
3700
+ /** {zh} @brief 当前播放会话最终解析出的 ABR 决策引擎。 */
3701
+ /** {en} @brief ABR decision engine resolved for the current playback session. */
3702
+ engine: ResolvedAbrEngine;
3703
+ /** {zh} @brief 当前清晰度决策使用的数据源。 */
3704
+ /** {en} @brief Data source used for the current rendition decision. */
3705
+ decisionSource: "hls-levels" | "definition-list" | "native" | "none";
3706
+ /** {zh} @brief 当前播放会话是否具备所选 ABR 引擎所需条件。 */
3707
+ /** {en} @brief Whether the selected ABR engine is available in the current session. */
3708
+ available: boolean;
3709
+ /** {zh} @brief 当前 ABR 决策引擎是否正在自动选档。 */
3710
+ /** {en} @brief Whether the resolved ABR engine is actively selecting renditions. */
3711
+ active: boolean;
3712
+ /** {zh} @brief 当前为自动模式还是手动模式。 */
3713
+ /** {en} @brief Whether the current mode is automatic or manual. */
3714
+ mode: HlsAbrMode;
3715
+ /** {zh} @brief hls.js 当前实际播放的 Level 索引。 */
3716
+ /** {en} @brief Current hls.js Level index being rendered. */
3717
+ currentLevel?: number;
3718
+ /** {zh} @brief VePlayer ABR 当前实际播放的清晰度。 */
3719
+ /** {en} @brief Current definition rendered by VePlayer ABR. */
3720
+ currentDefinition?: string;
3721
+ /** {zh} @brief ABR 不可用时的稳定原因码。 */
3722
+ /** {en} @brief Stable reason code when ABR is unavailable. */
3723
+ reason?: HlsAbrUnavailableReason;
3724
+ /** {zh} @brief 当前播放会话支持的 ABR 控制能力。 */
3725
+ /** {en} @brief ABR control capabilities supported by the current session. */
3726
+ capabilities: IHlsAbrCapabilities;
3727
+ }
3728
+ /** {zh}
3729
+ * @brief HLS ABR 上限;`null` 表示清除上限。
3730
+ * @detail ref
3731
+ */
3732
+ /** {en}
3733
+ * @brief HLS ABR limit; `null` clears the active limit.
3734
+ * @detail ref
3735
+ */
3736
+ export declare type IHlsAbrLimit = {
3737
+ type: "level";
3738
+ maxLevel: number;
3739
+ } | {
3740
+ type: "bitrate";
3741
+ maxBitrate: number;
3742
+ } | {
3743
+ type: "definition";
3744
+ maxDefinition: string;
3745
+ } | null;
3746
+ /** {zh}
3747
+ * @brief `HLS_ABR_ENGINE_RESOLVED` 事件数据。
3748
+ * @detail ref
3749
+ */
3750
+ /** {en}
3751
+ * @brief Payload of the `HLS_ABR_ENGINE_RESOLVED` event.
3752
+ * @detail ref
3753
+ */
3754
+ export interface IHlsAbrEngineResolvedEvent extends IHlsAbrState {
3755
+ }
3756
+ /** {zh}
3757
+ * @brief `HLS_ABR_STATE_CHANGE` 事件数据。
3758
+ * @detail ref
3759
+ */
3760
+ /** {en}
3761
+ * @brief Payload of the `HLS_ABR_STATE_CHANGE` event.
3762
+ * @detail ref
3763
+ */
3764
+ export interface IHlsAbrStateChangeEvent extends IHlsAbrState {
3765
+ }
3766
+ /** {zh}
3767
+ * @brief `HLS_ABR_LIMIT_CHANGE` 事件数据。
3768
+ * @detail ref
3769
+ */
3770
+ /** {en}
3771
+ * @brief Payload of the `HLS_ABR_LIMIT_CHANGE` event.
3772
+ * @detail ref
3773
+ */
3774
+ export interface IHlsAbrLimitChangeEvent {
3775
+ /** {zh} @brief 事件所属的播放会话 ID。 */
3776
+ /** {en} @brief Playback session ID that owns the event. */
3777
+ playbackSessionId: string;
3778
+ /** {zh} @brief 当前播放会话最终解析出的 ABR 决策引擎。 */
3779
+ /** {en} @brief ABR decision engine resolved for the current playback session. */
3780
+ engine: ResolvedAbrEngine;
3781
+ /** {zh} @brief 已生效的 ABR 上限;`null` 表示上限已清除。 */
3782
+ /** {en} @brief Applied ABR limit, or `null` when the limit has been cleared. */
3783
+ limit: IHlsAbrLimit;
3784
+ }
3785
+ /** {zh}
3786
+ * @brief Master M3U8 中一个标准化的 HLS Level;`index` 仅在当前播放会话内有效。
3787
+ * @detail ref
3788
+ */
3789
+ /** {en}
3790
+ * @brief A normalized HLS Level from a Master M3U8; `index` is valid only in the current playback session.
3791
+ * @detail ref
3792
+ */
3793
+ export interface IHlsLevel {
3794
+ /** {zh} @brief 当前播放会话内的 Level 索引。 */
3795
+ /** {en} @brief Level index within the current playback session. */
3796
+ index: number;
3797
+ /** {zh} @brief 峰值码率,单位为 bit/s。 */
3798
+ /** {en} @brief Peak bitrate in bits per second. */
3799
+ bitrate: number;
3800
+ /** {zh} @brief 平均码率,单位为 bit/s。 */
3801
+ /** {en} @brief Average bitrate in bits per second. */
3802
+ averageBitrate?: number;
3803
+ /** {zh} @brief 视频宽度,单位为像素。 */
3804
+ /** {en} @brief Video width in pixels. */
3805
+ width?: number;
3806
+ /** {zh} @brief 视频高度,单位为像素。 */
3807
+ /** {en} @brief Video height in pixels. */
3808
+ height?: number;
3809
+ /** {zh} @brief 视频帧率。 */
3810
+ /** {en} @brief Video frame rate. */
3811
+ frameRate?: number;
3812
+ /** {zh} @brief 视频编码标识。 */
3813
+ /** {en} @brief Video codec identifier. */
3814
+ videoCodec?: string;
3815
+ /** {zh} @brief 音频编码标识。 */
3816
+ /** {en} @brief Audio codec identifier. */
3817
+ audioCodec?: string;
3818
+ /** {zh} @brief 视频动态范围标识。 */
3819
+ /** {en} @brief Video dynamic-range identifier. */
3820
+ videoRange?: string;
3821
+ /** {zh} @brief Manifest 声明的 Level 名称。 */
3822
+ /** {en} @brief Level name declared by the manifest. */
3823
+ name?: string;
3824
+ }
3825
+ /** {zh}
3826
+ * @brief HLS Level 标签映射项。
3827
+ * @detail ref
3828
+ */
3829
+ /** {en}
3830
+ * @brief Mapping item used to customize an HLS Level label.
3831
+ * @detail ref
3832
+ */
3833
+ export interface IHlsLevelLabelItem {
3834
+ /** {zh} @brief 当多语言 key 无法解析时使用的回退文案。 */
3835
+ /** {en} @brief Fallback text used when the i18n key cannot be resolved. */
3836
+ text?: string;
3837
+ /** {zh} @brief 从播放器当前多语言词典中读取文案的 key。 */
3838
+ /** {en} @brief Key resolved from the player's active i18n dictionary. */
3839
+ textKey?: string;
3840
+ }
3841
+ /** {zh}
3842
+ * @brief HLS Level 标签格式化上下文。
3843
+ * @detail ref
3844
+ */
3845
+ /** {en}
3846
+ * @brief Context passed to the HLS Level label formatter.
3847
+ * @detail ref
3848
+ */
3849
+ export interface IHlsLevelLabelContext {
3850
+ /** {zh} @brief 当前 Level 的只读安全快照。 */
3851
+ /** {en} @brief Read-only safe snapshot of the current Level. */
3852
+ level: Readonly<IHlsLevel>;
3853
+ /** {zh} @brief 当前播放会话全部 Level 的只读安全快照。 */
3854
+ /** {en} @brief Read-only safe snapshots of all Levels in the current playback session. */
3855
+ levels: ReadonlyArray<Readonly<IHlsLevel>>;
3856
+ /** {zh} @brief 视频短边像素值;Manifest 未提供分辨率时为空。 */
3857
+ /** {en} @brief Video short edge in pixels, or undefined when dimensions are unavailable. */
3858
+ shortEdge?: number;
3859
+ /** {zh} @brief 未本地化、未消歧的标准标签。 */
3860
+ /** {en} @brief Canonical label before localization and disambiguation. */
3861
+ canonicalLabel: string;
3862
+ /** {zh} @brief 应用 `textKey` 或 `text` 后的基础标签。 */
3863
+ /** {en} @brief Base label after applying `textKey` or `text`. */
3864
+ localizedLabel: string;
3865
+ /** {zh} @brief 完成 SDK 默认重名消歧后的标签。 */
3866
+ /** {en} @brief Label after the SDK's default duplicate disambiguation. */
3867
+ defaultLabel: string;
3868
+ /** {zh} @brief 播放器当前语言。 */
3869
+ /** {en} @brief Current player language. */
3870
+ lang: string;
3871
+ /** {zh} @brief 当前标准标签是否在 Level 列表中重复。 */
3872
+ /** {en} @brief Whether the canonical label is duplicated in the Level list. */
3873
+ duplicated: boolean;
3874
+ }
3875
+ /** {zh}
3876
+ * @brief HLS Level 标签的多语言映射与自定义格式化配置。
3877
+ * @detail ref
3878
+ * @example
3879
+ * ``` javascript
3880
+ * hlsLevelLabel: {
3881
+ * map: {
3882
+ * '720p': { textKey: 'HLS_LEVEL_HD', text: '720p' }
3883
+ * },
3884
+ * formatter: ({ defaultLabel, level }) =>
3885
+ * level.videoRange === 'PQ' ? `${defaultLabel} HDR` : defaultLabel
3886
+ * }
3887
+ * ```
3888
+ */
3889
+ /** {en}
3890
+ * @brief Localization mapping and custom formatter for HLS Level labels.
3891
+ * @detail ref
3892
+ * @example
3893
+ * ``` javascript
3894
+ * hlsLevelLabel: {
3895
+ * map: {
3896
+ * '720p': { textKey: 'HLS_LEVEL_HD', text: '720p' }
3897
+ * },
3898
+ * formatter: ({ defaultLabel, level }) =>
3899
+ * level.videoRange === 'PQ' ? `${defaultLabel} HDR` : defaultLabel
3900
+ * }
3901
+ * ```
3902
+ */
3903
+ export interface IHlsLevelLabelOptions {
3904
+ /** {zh} @brief 按标准标签(如 `720p`、`1080p`)配置展示文案。 */
3905
+ /** {en} @brief Display-label mappings keyed by canonical labels such as `720p` and `1080p`. */
3906
+ map?: Record<string, IHlsLevelLabelItem>;
3907
+ /** {zh} @brief 同步格式化最终标签;返回空值或抛出异常时回退到 `defaultLabel`。 */
3908
+ /** {en} @brief Synchronously formats the final label; empty returns or exceptions fall back to `defaultLabel`. */
3909
+ formatter?: (context: IHlsLevelLabelContext) => string | null | undefined;
3910
+ }
3911
+ /** {zh}
3912
+ * @brief 当前播放会话的 HLS Level 状态快照。
3913
+ * @detail ref
3914
+ */
3915
+ /** {en}
3916
+ * @brief HLS Level state snapshot for the current playback session.
3917
+ * @detail ref
3918
+ */
3919
+ export interface IHlsLevelState {
3920
+ /** {zh} @brief 播放会话 ID,用于识别过期状态和事件。 */
3921
+ /** {en} @brief Playback session ID used to reject stale state and events. */
3922
+ playbackSessionId: string;
3923
+ /** {zh} @brief Level 列表是否已就绪。 */
3924
+ /** {en} @brief Whether the Level list is ready. */
3925
+ ready: boolean;
3926
+ /** {zh} @brief 当前播放会话内的标准化 Level 列表。 */
3927
+ /** {en} @brief Normalized Level list for the current playback session. */
3928
+ levels: IHlsLevel[];
3929
+ /** {zh} @brief 当前实际播放的 Level 索引,未知时为 `-1`。 */
3930
+ /** {en} @brief Currently rendered Level index, or `-1` when unknown. */
3931
+ currentLevel: number;
3932
+ /** {zh} @brief 当前加载的 Level 索引,未知时为 `-1`。 */
3933
+ /** {en} @brief Currently loaded Level index, or `-1` when unknown. */
3934
+ loadLevel: number;
3935
+ /** {zh} @brief 下一个分片使用的 Level 索引,未知时为 `-1`。 */
3936
+ /** {en} @brief Level index for the next fragment, or `-1` when unknown. */
3937
+ nextLevel: number;
3938
+ /** {zh} @brief 手动 Level 索引;自动模式下为 `-1`。 */
3939
+ /** {en} @brief Manual Level index; `-1` in automatic mode. */
3940
+ manualLevel: number;
3941
+ /** {zh} @brief hls.js 是否处于自动选档模式。 */
3942
+ /** {en} @brief Whether hls.js automatic Level selection is enabled. */
3943
+ autoLevelEnabled: boolean;
3944
+ /** {zh} @brief hls.js 自动选档的 Level 上限;未设置时为 `-1`。 */
3945
+ /** {en} @brief hls.js automatic Level cap; `-1` when unset. */
3946
+ autoLevelCapping: number;
3947
+ }
3948
+ /** {zh}
3949
+ * @brief HLS Level 手动切换模式。
3950
+ * @detail ref
3951
+ */
3952
+ /** {en}
3953
+ * @brief Manual HLS Level switching mode.
3954
+ * @detail ref
3955
+ */
3956
+ export declare type HlsLevelSwitchMode = "immediate" | "next-fragment" | "smooth";
3957
+ /** {zh}
3958
+ * @brief 手动切换 HLS Level 的选项。
3959
+ * @detail ref
3960
+ */
3961
+ /** {en}
3962
+ * @brief Options for manually switching an HLS Level.
3963
+ * @detail ref
3964
+ */
3965
+ export interface IHlsLevelSwitchOptions {
3966
+ /** {zh} @brief 切换模式,默认为 `next-fragment`。 */
3967
+ /** {en} @brief Switching mode. Defaults to `next-fragment`. */
3968
+ mode?: HlsLevelSwitchMode;
3969
+ /** {zh} @brief 可选的播放会话 ID;不匹配时拒绝本次切换。 */
3970
+ /** {en} @brief Optional playback session ID; a mismatch rejects the switch. */
3971
+ playbackSessionId?: string;
3972
+ }
3973
+ /** {zh}
3974
+ * @brief HLS Level 切换事件数据。
3975
+ * @detail ref
3976
+ */
3977
+ /** {en}
3978
+ * @brief HLS Level switching event payload.
3979
+ * @detail ref
3980
+ */
3981
+ export interface IHlsLevelSwitchEvent {
3982
+ /** {zh} @brief 事件所属的播放会话 ID。 */
3983
+ /** {en} @brief Playback session ID that owns the event. */
3984
+ playbackSessionId: string;
3985
+ /** {zh} @brief 切换前的 Level 索引。 */
3986
+ /** {en} @brief Level index before switching. */
3987
+ from: number;
3988
+ /** {zh} @brief 目标或已切换到的 Level 索引。 */
3989
+ /** {en} @brief Target or switched-to Level index. */
3990
+ to: number;
3991
+ /** {zh} @brief 本次切换由手动操作还是 ABR 触发。 */
3992
+ /** {en} @brief Whether the switch was triggered manually or by ABR. */
3993
+ reason: "manual" | "abr";
3994
+ /** {zh} @brief 当前播放会话的 ABR 决策引擎。 */
3995
+ /** {en} @brief ABR decision engine for the current playback session. */
3996
+ abrEngine: ResolvedAbrEngine;
3997
+ /** {zh} @brief 目标或已生效的安全 Level 快照。 */
3998
+ /** {en} @brief Safe snapshot of the target or active Level. */
3999
+ level?: IHlsLevel;
4000
+ }
4001
+ /** {zh}
4002
+ * @brief `HLS_SUBTITLE_TRACKS_UPDATED` 事件数据。
4003
+ * @detail ref
4004
+ */
4005
+ /** {en}
4006
+ * @brief Payload of the `HLS_SUBTITLE_TRACKS_UPDATED` event.
4007
+ * @detail ref
4008
+ */
4009
+ export interface IHlsSubtitleTracksUpdatedEvent {
4010
+ /** {zh} @brief 事件所属的播放会话 ID。 */
4011
+ /** {en} @brief Playback session ID that owns the event. */
4012
+ playbackSessionId: string;
4013
+ /** {zh} @brief 当前实际使用的 HLS 播放内核。 */
4014
+ /** {en} @brief HLS playback engine actually used by the session. */
4015
+ playbackEngine: HlsPlaybackEngine;
4016
+ /** {zh} @brief 不含播放地址和底层轨道索引的安全字幕列表。 */
4017
+ /** {en} @brief Safe subtitle list without media URLs or internal track indexes. */
4018
+ tracks: ReadonlyArray<ISubTitleItem>;
4019
+ }
4020
+ /** {zh}
4021
+ * @brief HLS 字幕轨切换事件数据。
4022
+ * @detail ref
4023
+ */
4024
+ /** {en}
4025
+ * @brief HLS subtitle-track switching event payload.
4026
+ * @detail ref
4027
+ */
4028
+ export interface IHlsSubtitleTrackSwitchEvent {
4029
+ /** {zh} @brief 事件所属的播放会话 ID。 */
4030
+ /** {en} @brief Playback session ID that owns the event. */
4031
+ playbackSessionId: string;
4032
+ /** {zh} @brief 当前实际使用的 HLS 播放内核。 */
4033
+ /** {en} @brief HLS playback engine actually used by the session. */
4034
+ playbackEngine: HlsPlaybackEngine;
4035
+ /** {zh} @brief 切换前的安全字幕 ID;关闭状态为 `null`。 */
4036
+ /** {en} @brief Safe subtitle ID before switching, or `null` when disabled. */
4037
+ from: string | number | null;
4038
+ /** {zh} @brief 目标或已生效的安全字幕 ID;关闭状态为 `null`。 */
4039
+ /** {en} @brief Target or active safe subtitle ID, or `null` when disabled. */
4040
+ to: string | number | null;
4041
+ /** {zh} @brief 目标或已生效的安全字幕快照。 */
4042
+ /** {en} @brief Safe snapshot of the target or active subtitle track. */
4043
+ track?: ISubTitleItem;
4044
+ }
4045
+ /** {zh}
4046
+ * @brief HLS 控制 API 的标准错误码。
4047
+ * @detail ref
4048
+ */
4049
+ /** {en}
4050
+ * @brief Standard error codes for HLS control APIs.
4051
+ * @detail ref
4052
+ */
4053
+ 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";
4054
+ /** {zh}
4055
+ * @brief HLS Level、ABR 或字幕控制失败时抛出的标准错误。
4056
+ * @detail Api
4057
+ */
4058
+ /** {en}
4059
+ * @brief Standard error thrown when HLS Level, ABR, or subtitle control fails.
4060
+ * @detail Api
4061
+ */
4062
+ export declare class HlsControlError extends Error {
4063
+ /** {zh} @brief 稳定的 HLS 控制错误码。 */
4064
+ /** {en} @brief Stable HLS control error code. */
4065
+ readonly code: HlsControlErrorCode;
4066
+ constructor(code: HlsControlErrorCode, message: string);
4067
+ }
3418
4068
  export declare type TAPIRegionConfig = {
3419
4069
  __PLAY_DOMAIN__: string;
3420
4070
  __BACKUP_PLAY_DOMAIN__?: string;
@@ -4686,6 +5336,7 @@ export interface IPlayerConfig extends IPlayerOptions {
4686
5336
  * - **Android**:直接启用 hls.js 播放。
4687
5337
  * - **iOS**:仅在设备支持 `ManagedMediaSource`(iOS 17.1+,即 `VePlayer.isMMSSupported()` 为 `true`)时启用;
4688
5338
  * 不满足时自动回退至原生 HLS 播放。
5339
+ * - **`isMobile` 模拟模式**:当前浏览器支持 MSE 或 MMS 时启用 hls.js。
4689
5340
  * 开启后可在移动端解锁多音轨切换、`setAudioOption` 偏好持久化等 hls.js 特有能力。
4690
5341
  * @default false
4691
5342
  */
@@ -4694,13 +5345,82 @@ export interface IPlayerConfig extends IPlayerOptions {
4694
5345
  * - **Android**: always enables hls.js.
4695
5346
  * - **iOS**: enables hls.js only when `ManagedMediaSource` is supported (iOS 17.1+,
4696
5347
  * i.e. `VePlayer.isMMSSupported()` returns `true`); falls back to native HLS otherwise.
5348
+ * - **`isMobile` simulation**: enables hls.js when the current browser supports MSE or MMS.
4697
5349
  * Unlocks hls.js-specific features such as multi-audio-track switching on mobile.
4698
5350
  * @default false
4699
5351
  */
4700
5352
  enableMobileHlsPlugin?: boolean;
4701
5353
  /** {zh}
4702
- * @brief 是否启用 {@link https://hlsjs.video-dev.org/ hls.js} 插件播放HLS视频,默认为true,设置为false后,PC端播放HLS使用自研hls插件播放HLS视频
4703
- * @default true
5354
+ * @brief 清晰度插件手动切换 HLS Level 时使用的切换模式。
5355
+ * @notes 仅在 hls.js/MSE/MMS 模式下生效;默认值为 `next-fragment`。直接调用 `setHlsLevel()` 时,以方法参数中的 `mode` 为准。
5356
+ * @default next-fragment
5357
+ * @example
5358
+ * ``` javascript
5359
+ * const playerSdkIns = new VePlayer({
5360
+ * hlsLevelSwitchMode: 'smooth'
5361
+ * });
5362
+ * ```
5363
+ */
5364
+ /** {en}
5365
+ * @brief Switching mode used when the quality plugin manually selects an HLS Level.
5366
+ * @notes Effective only in hls.js/MSE/MMS mode. Defaults to `next-fragment`. A `mode` passed directly to `setHlsLevel()` takes precedence for that call.
5367
+ * @default next-fragment
5368
+ * @example
5369
+ * ``` javascript
5370
+ * const playerSdkIns = new VePlayer({
5371
+ * hlsLevelSwitchMode: 'smooth'
5372
+ * });
5373
+ * ```
5374
+ */
5375
+ hlsLevelSwitchMode?: HlsLevelSwitchMode;
5376
+ /** {zh}
5377
+ * @brief Master M3U8 的 HLS Level 标签多语言映射与自定义格式化配置。
5378
+ * @notes 仅影响内置清晰度插件的展示文案,不改变 Level 索引、切档行为或 ABR 决策。映射 key 为视频短边生成的标准标签,例如 `720p`、`1080p`。
5379
+ * @default -
5380
+ * @example
5381
+ * ``` javascript
5382
+ * const playerSdkIns = new VePlayer({
5383
+ * lang: 'zh',
5384
+ * languages: {
5385
+ * zh: { HLS_LEVEL_HD: '高清' },
5386
+ * en: { HLS_LEVEL_HD: 'HD' }
5387
+ * },
5388
+ * hlsLevelLabel: {
5389
+ * map: {
5390
+ * '720p': { textKey: 'HLS_LEVEL_HD', text: '720p' }
5391
+ * },
5392
+ * formatter: ({ defaultLabel, level }) =>
5393
+ * level.videoRange === 'PQ' ? `${defaultLabel} HDR` : defaultLabel
5394
+ * }
5395
+ * });
5396
+ * ```
5397
+ */
5398
+ /** {en}
5399
+ * @brief Localization mapping and custom formatter for Master M3U8 HLS Level labels.
5400
+ * @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`.
5401
+ * @default -
5402
+ * @example
5403
+ * ``` javascript
5404
+ * const playerSdkIns = new VePlayer({
5405
+ * lang: 'en',
5406
+ * languages: {
5407
+ * zh: { HLS_LEVEL_HD: '高清' },
5408
+ * en: { HLS_LEVEL_HD: 'HD' }
5409
+ * },
5410
+ * hlsLevelLabel: {
5411
+ * map: {
5412
+ * '720p': { textKey: 'HLS_LEVEL_HD', text: '720p' }
5413
+ * },
5414
+ * formatter: ({ defaultLabel, level }) =>
5415
+ * level.videoRange === 'PQ' ? `${defaultLabel} HDR` : defaultLabel
5416
+ * }
5417
+ * });
5418
+ * ```
5419
+ */
5420
+ hlsLevelLabel?: IHlsLevelLabelOptions;
5421
+ /** {zh}
5422
+ * @brief 是否启用 {@link https://hlsjs.video-dev.org/ hls.js} 插件播放HLS视频,默认为true,设置为false后,PC端播放HLS使用自研hls插件播放HLS视频
5423
+ * @default true
4704
5424
  */
4705
5425
  /** {en}
4706
5426
  * @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.
@@ -6470,6 +7190,7 @@ declare class AuthToken extends SdkPlugin {
6470
7190
  beforePlayerCreate(): Promise<void>;
6471
7191
  getVideoInfo(sourceConfigs?: IPlayerConfig): Promise<{
6472
7192
  vid: string;
7193
+ __mediaInfoCacheHit: boolean;
6473
7194
  playList: Stream[];
6474
7195
  codec: ICodecType;
6475
7196
  defaultDefinition: string;
@@ -6575,6 +7296,238 @@ declare abstract class AbstractBaseAdapter {
6575
7296
  abstract getPlugins(umdLoader: UMDLoader): Promise<XGPlugin[]>;
6576
7297
  abstract setPluginConfigInVid(videoInfo: IVideoInfo, context: AuthToken): void;
6577
7298
  }
7299
+ /** {zh}
7300
+ * @list Options
7301
+ * @brief 字幕项。
7302
+ * @kind property
7303
+ */
7304
+ /** {en}
7305
+ * @list Options
7306
+ * @brief Subtitle item.
7307
+ * @kind property
7308
+ */
7309
+ export interface ISubTitleItem {
7310
+ /** {zh}
7311
+ * @brief 字幕来源。业务配置字幕为 `config`,Master M3U8 或原生 HLS 字幕为 `hls`。
7312
+ * @default config
7313
+ */
7314
+ /** {en}
7315
+ * @brief Subtitle source. Business-configured subtitles use `config`; Master M3U8 or native HLS subtitles use `hls`.
7316
+ * @default config
7317
+ */
7318
+ source?: "config" | "hls";
7319
+ /** {zh}
7320
+ * @brief 字幕语言。
7321
+ * @default -
7322
+ */
7323
+ /** {en}
7324
+ * @brief Subtitle language.
7325
+ * @default -
7326
+ */
7327
+ language?: string | number;
7328
+ /** {zh}
7329
+ * @brief 字幕 ID。
7330
+ * @default -
7331
+ */
7332
+ /** {en}
7333
+ * @brief Subtitle ID.
7334
+ * @default -
7335
+ */
7336
+ id?: number | string;
7337
+ /** {zh}
7338
+ * @brief 是否为默认选择的字幕。
7339
+ * @default false
7340
+ */
7341
+ /** {en}
7342
+ * @brief Whether this is the default selected subtitle.
7343
+ * @default false
7344
+ */
7345
+ isDefault?: boolean;
7346
+ /** {zh}
7347
+ * @brief 是否为强制字幕轨。
7348
+ * @default false
7349
+ */
7350
+ /** {en}
7351
+ * @brief Whether the subtitle track is forced.
7352
+ * @default false
7353
+ */
7354
+ forced?: boolean;
7355
+ /** {zh}
7356
+ * @brief HLS 字幕轨的特征标识,例如无障碍字幕特征;未声明时为空。
7357
+ * @default -
7358
+ */
7359
+ /** {en}
7360
+ * @brief HLS subtitle-track characteristics, such as accessibility traits; absent when not declared.
7361
+ * @default -
7362
+ */
7363
+ characteristics?: string;
7364
+ /** {zh}
7365
+ * @brief 字幕名称。
7366
+ * @default -
7367
+ */
7368
+ /** {en}
7369
+ * @brief Subtitle display name.
7370
+ * @default -
7371
+ */
7372
+ text?: ISubtitleLabelValue;
7373
+ /** {zh}
7374
+ * @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
7375
+ * @default -
7376
+ */
7377
+ /** {en}
7378
+ * @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
7379
+ * @default -
7380
+ */
7381
+ label?: ISubtitleLabelValue;
7382
+ /** {zh}
7383
+ * @brief 外挂字幕 URL 地址。
7384
+ * @default -
7385
+ */
7386
+ /** {en}
7387
+ * @brief External subtitle URL.
7388
+ * @default -
7389
+ */
7390
+ url?: string;
7391
+ /**
7392
+ * @hidden
7393
+ * @type {string}
7394
+ * @memberof ISubTitleItem
7395
+ */
7396
+ stringContent?: string;
7397
+ /** {zh}
7398
+ * @brief 字幕内容列表。非 `url` 形式时使用。
7399
+ * @default -
7400
+ * @type {Array<Object>}
7401
+ * @memberof ISubTitleItem
7402
+ */
7403
+ /** {en}
7404
+ * @brief Subtitle content list when not using URL.
7405
+ * @default -
7406
+ * @type {Array<Object>}
7407
+ * @memberof ISubTitleItem
7408
+ */
7409
+ list?: IListItem[];
7410
+ }
7411
+ /** {zh}
7412
+ * @brief 字幕项名称,可为静态文案或按播放器语言配置的文案表。
7413
+ * @detail ref
7414
+ */
7415
+ /** {en}
7416
+ * @brief Subtitle item name as static text or a text map keyed by player language.
7417
+ * @detail ref
7418
+ */
7419
+ export type ISubtitleLabelValue = string | number | Record<string, string | number>;
7420
+ /** {zh}
7421
+ * @brief 字幕内容项。
7422
+ * @list Options
7423
+ * @kind property
7424
+ * @export
7425
+ * @interface IListItem
7426
+ */
7427
+ /** {en}
7428
+ * @brief Subtitle content item.
7429
+ * @list Options
7430
+ * @kind property
7431
+ * @export
7432
+ * @interface IListItem
7433
+ */
7434
+ export interface IListItem {
7435
+ /** {zh}
7436
+ * @brief 开始时间,单位为秒。
7437
+ * @type {number}
7438
+ */
7439
+ /** {en}
7440
+ * @brief Start time in seconds.
7441
+ * @type {number}
7442
+ */
7443
+ start: number;
7444
+ /** {zh}
7445
+ * @brief 结束时间,单位为秒。
7446
+ * @type {number}
7447
+ */
7448
+ /** {en}
7449
+ * @brief End time in seconds.
7450
+ * @type {number}
7451
+ */
7452
+ end: number;
7453
+ /** {zh}
7454
+ * @brief 字幕数据列表。
7455
+ * @type {Array<ITextItem>}
7456
+ */
7457
+ /** {en}
7458
+ * @brief Subtitle cue data list.
7459
+ * @type {Array<ITextItem>}
7460
+ */
7461
+ list: Array<ITextItem>;
7462
+ /**
7463
+ * @hidden
7464
+ * @type {any}
7465
+ */
7466
+ [propName: string]: any;
7467
+ }
7468
+ /** {zh}
7469
+ * @brief 字幕文案配置。
7470
+ * @list Options
7471
+ * @kind property
7472
+ */
7473
+ /** {en}
7474
+ * @brief Subtitle text item configuration.
7475
+ * @list Options
7476
+ * @kind property
7477
+ */
7478
+ export interface ITextItem {
7479
+ /**
7480
+ * @hidden
7481
+ * @type {any}
7482
+ */
7483
+ [propName: string]: any;
7484
+ /** {zh}
7485
+ * @brief 开始时间,单位为秒。
7486
+ * @type {number}
7487
+ */
7488
+ /** {en}
7489
+ * @brief Start time in seconds.
7490
+ * @type {number}
7491
+ */
7492
+ start: number;
7493
+ /** {zh}
7494
+ * @brief 结束时间,单位为秒。
7495
+ * @type {number}
7496
+ */
7497
+ /** {en}
7498
+ * @brief End time in seconds.
7499
+ * @type {number}
7500
+ */
7501
+ end: number;
7502
+ /** {zh}
7503
+ * @brief 字幕文案数组。
7504
+ * @type {string[]}
7505
+ */
7506
+ /** {en}
7507
+ * @brief Subtitle text array.
7508
+ * @type {string[]}
7509
+ */
7510
+ text: string[];
7511
+ /** {zh}
7512
+ * @brief 字幕顺序。
7513
+ * @type {number}
7514
+ */
7515
+ /** {en}
7516
+ * @brief Subtitle display order.
7517
+ * @type {number}
7518
+ */
7519
+ index?: number;
7520
+ }
7521
+ /** {zh}
7522
+ * @brief HLS 自动码率决策引擎配置值。
7523
+ * @detail ref
7524
+ */
7525
+ /** {en}
7526
+ * @brief Configurable HLS adaptive-bitrate decision engine.
7527
+ * @detail ref
7528
+ */
7529
+ export type HlsAbrEngine = "hlsjs" | "veplayer";
7530
+ export type TLogChannel = "cn" | "va" | "sg";
6578
7531
  declare class PlayerData {
6579
7532
  id?: string;
6580
7533
  root?: HTMLElement;
@@ -6676,6 +7629,8 @@ declare class PlayerData {
6676
7629
  */
6677
7630
  getCurrentStreamType(): string;
6678
7631
  getStreamType(): string;
7632
+ getConfiguredHlsAbrEngine(): HlsAbrEngine;
7633
+ isOpenVePlayerABR(): boolean;
6679
7634
  isOpenABR(): boolean;
6680
7635
  showRealDefinition(): boolean;
6681
7636
  isAutoDefinition(def: any): boolean;
@@ -7050,205 +8005,18 @@ export declare type IMediaInfoPrefetchFailure = {
7050
8005
  export declare type IMediaInfoPrefetchResult = IMediaInfoPrefetchSuccess | IMediaInfoPrefetchFailure;
7051
8006
  export declare type IPreloadStream = IPreloadResolvedStream | IPreloadDramaStream | IPreloadAuthTokenStream;
7052
8007
  /** {zh}
7053
- * @list Options
7054
- * @brief 字幕项。
7055
- * @kind property
8008
+ * @hidden
8009
+ * h265策略配置
8010
+ * @detail Options
7056
8011
  */
7057
8012
  /** {en}
7058
- * @list Options
7059
- * @brief Subtitle item.
7060
- * @kind property
8013
+ * @hidden
8014
+ * @brief H.265 strategy configuration.
8015
+ * @detail Options
7061
8016
  */
7062
- export interface ISubTitleItem {
8017
+ export declare type IH265Config = {
7063
8018
  /** {zh}
7064
- * @brief 字幕语言。
7065
- * @default -
7066
- */
7067
- /** {en}
7068
- * @brief Subtitle language.
7069
- * @default -
7070
- */
7071
- language?: string | number;
7072
- /** {zh}
7073
- * @brief 字幕 ID。
7074
- * @default -
7075
- */
7076
- /** {en}
7077
- * @brief Subtitle ID.
7078
- * @default -
7079
- */
7080
- id?: number | string;
7081
- /** {zh}
7082
- * @brief 是否为默认选择的字幕。
7083
- * @default false
7084
- */
7085
- /** {en}
7086
- * @brief Whether this is the default selected subtitle.
7087
- * @default false
7088
- */
7089
- isDefault?: boolean;
7090
- /** {zh}
7091
- * @brief 字幕名称。
7092
- * @default -
7093
- */
7094
- /** {en}
7095
- * @brief Subtitle display name.
7096
- * @default -
7097
- */
7098
- text?: string;
7099
- /** {zh}
7100
- * @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
7101
- * @default -
7102
- */
7103
- /** {en}
7104
- * @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
7105
- * @default -
7106
- */
7107
- label?: string | number;
7108
- /** {zh}
7109
- * @brief 外挂字幕 URL 地址。
7110
- * @default -
7111
- */
7112
- /** {en}
7113
- * @brief External subtitle URL.
7114
- * @default -
7115
- */
7116
- url?: string;
7117
- /**
7118
- * @hidden
7119
- * @type {string}
7120
- * @memberof ISubTitleItem
7121
- */
7122
- stringContent?: string;
7123
- /** {zh}
7124
- * @brief 字幕内容列表。非 `url` 形式时使用。
7125
- * @default -
7126
- * @type {Array<Object>}
7127
- * @memberof ISubTitleItem
7128
- */
7129
- /** {en}
7130
- * @brief Subtitle content list when not using URL.
7131
- * @default -
7132
- * @type {Array<Object>}
7133
- * @memberof ISubTitleItem
7134
- */
7135
- list?: IListItem[];
7136
- }
7137
- /** {zh}
7138
- * @brief 字幕内容项。
7139
- * @list Options
7140
- * @kind property
7141
- * @export
7142
- * @interface IListItem
7143
- */
7144
- /** {en}
7145
- * @brief Subtitle content item.
7146
- * @list Options
7147
- * @kind property
7148
- * @export
7149
- * @interface IListItem
7150
- */
7151
- export interface IListItem {
7152
- /** {zh}
7153
- * @brief 开始时间,单位为秒。
7154
- * @type {number}
7155
- */
7156
- /** {en}
7157
- * @brief Start time in seconds.
7158
- * @type {number}
7159
- */
7160
- start: number;
7161
- /** {zh}
7162
- * @brief 结束时间,单位为秒。
7163
- * @type {number}
7164
- */
7165
- /** {en}
7166
- * @brief End time in seconds.
7167
- * @type {number}
7168
- */
7169
- end: number;
7170
- /** {zh}
7171
- * @brief 字幕数据列表。
7172
- * @type {Array<ITextItem>}
7173
- */
7174
- /** {en}
7175
- * @brief Subtitle cue data list.
7176
- * @type {Array<ITextItem>}
7177
- */
7178
- list: Array<ITextItem>;
7179
- /**
7180
- * @hidden
7181
- * @type {any}
7182
- */
7183
- [propName: string]: any;
7184
- }
7185
- /** {zh}
7186
- * @brief 字幕文案配置。
7187
- * @list Options
7188
- * @kind property
7189
- */
7190
- /** {en}
7191
- * @brief Subtitle text item configuration.
7192
- * @list Options
7193
- * @kind property
7194
- */
7195
- export interface ITextItem {
7196
- /**
7197
- * @hidden
7198
- * @type {any}
7199
- */
7200
- [propName: string]: any;
7201
- /** {zh}
7202
- * @brief 开始时间,单位为秒。
7203
- * @type {number}
7204
- */
7205
- /** {en}
7206
- * @brief Start time in seconds.
7207
- * @type {number}
7208
- */
7209
- start: number;
7210
- /** {zh}
7211
- * @brief 结束时间,单位为秒。
7212
- * @type {number}
7213
- */
7214
- /** {en}
7215
- * @brief End time in seconds.
7216
- * @type {number}
7217
- */
7218
- end: number;
7219
- /** {zh}
7220
- * @brief 字幕文案数组。
7221
- * @type {string[]}
7222
- */
7223
- /** {en}
7224
- * @brief Subtitle text array.
7225
- * @type {string[]}
7226
- */
7227
- text: string[];
7228
- /** {zh}
7229
- * @brief 字幕顺序。
7230
- * @type {number}
7231
- */
7232
- /** {en}
7233
- * @brief Subtitle display order.
7234
- * @type {number}
7235
- */
7236
- index?: number;
7237
- }
7238
- export type TLogChannel = "cn" | "va" | "sg";
7239
- /** {zh}
7240
- * @hidden
7241
- * h265策略配置
7242
- * @detail Options
7243
- */
7244
- /** {en}
7245
- * @hidden
7246
- * @brief H.265 strategy configuration.
7247
- * @detail Options
7248
- */
7249
- export declare type IH265Config = {
7250
- /** {zh}
7251
- * @brief h265策略依赖Module
8019
+ * @brief h265策略依赖Module
7252
8020
  */
7253
8021
  /** {en}
7254
8022
  * @brief H.265 strategy dependency module.
@@ -7743,6 +8511,14 @@ declare class VePlayer {
7743
8511
  * @memberof VePlayer
7744
8512
  */
7745
8513
  private _emitter;
8514
+ /** @hidden 当前播放内核对应的 Master M3U8 Level 控制器。 */
8515
+ private _hlsMasterController;
8516
+ /** @hidden 当前播放内核对应的 Master M3U8 字幕适配器。 */
8517
+ private _hlsSubtitleAdapter;
8518
+ /** @hidden 当前播放世代中业务显式配置的字幕列表快照。 */
8519
+ private _explicitSubtitleListSnapshot;
8520
+ /** @hidden 在播放会话提交后刷新 Level 快照与事件归属。 */
8521
+ private _hlsMasterRefreshListener?;
7746
8522
  /** 最近一次用户选择的音轨,用于清晰度切换后通过 setAudioOption 恢复音轨 */
7747
8523
  private _lastSelectedAudioTrack;
7748
8524
  /**
@@ -8301,6 +9077,14 @@ declare class VePlayer {
8301
9077
  * @memberof VePlayer
8302
9078
  */
8303
9079
  afterPlayerCreate(): void;
9080
+ /** @hidden 为当前播放内核挂载会话隔离的 Master M3U8 Level 控制器。 */
9081
+ private _mountHlsMasterController;
9082
+ /** @hidden 为当前 hls.js 播放会话挂载安全的 Master 字幕适配器。 */
9083
+ private _mountHlsSubtitleAdapter;
9084
+ /** @hidden 克隆业务字幕策略,避免由运行时注入列表反推来源。 */
9085
+ private _cloneExplicitSubtitleList;
9086
+ /** @hidden 返回稳定的 Level 会话刷新监听器,便于销毁时精确解绑。 */
9087
+ private _getHlsMasterRefreshListener;
8304
9088
  _setVeError(): void;
8305
9089
  /**
8306
9090
  * @hidden
@@ -8615,12 +9399,177 @@ declare class VePlayer {
8615
9399
  /** {en}
8616
9400
  * @brief Get the definition list. Each item has `definition`, `url`, and `selected` (true for the active level).
8617
9401
  */
8618
- getDefinitionList(): Array<{
8619
- definition: string;
8620
- url: IUrl;
8621
- selected: boolean;
8622
- [propName: string]: any;
8623
- }>;
9402
+ getDefinitionList(): Array<{
9403
+ definition: string;
9404
+ url: IUrl;
9405
+ selected: boolean;
9406
+ [propName: string]: any;
9407
+ }>;
9408
+ /** {zh}
9409
+ * @brief 获取当前播放会话中由 Master M3U8 解析出的 HLS Level 列表。
9410
+ * @list Api
9411
+ * @returns 标准化后的 HLS Level 快照;Manifest 未就绪或当前不是 hls.js 内核时返回空数组。
9412
+ * @notes Level 的 `index` 只在当前 `playbackSessionId` 内有效;返回结果不包含播放地址和鉴权信息。
9413
+ * @example
9414
+ * ``` javascript
9415
+ * const levels = playerSdkIns.getHlsLevels();
9416
+ * console.log(levels.map(level => `${level.height}p`));
9417
+ * ```
9418
+ */
9419
+ /** {en}
9420
+ * @brief Get HLS Levels parsed from the Master M3U8 for the current playback session.
9421
+ * @list Api
9422
+ * @returns A normalized HLS Level snapshot. Returns an empty array before the manifest is ready or when hls.js is not the active engine.
9423
+ * @notes A Level `index` is valid only for the current `playbackSessionId`. Playback URLs and authorization data are never returned.
9424
+ * @example
9425
+ * ``` javascript
9426
+ * const levels = playerSdkIns.getHlsLevels();
9427
+ * console.log(levels.map(level => `${level.height}p`));
9428
+ * ```
9429
+ */
9430
+ getHlsLevels(): IHlsLevel[];
9431
+ /** {zh}
9432
+ * @brief 获取当前播放会话的 HLS Level 状态。
9433
+ * @list Api
9434
+ * @returns HLS Level 状态快照,包含列表就绪状态、实际档位、手动档位和自动选档上限。
9435
+ * @notes `READY` 事件不表示 Level 列表已经就绪;请检查返回值的 `ready`,或监听 `HLS_LEVELS_UPDATED`。
9436
+ * @example
9437
+ * ``` javascript
9438
+ * const state = playerSdkIns.getHlsLevelState();
9439
+ * if (state.ready) {
9440
+ * console.log(state.currentLevel, state.autoLevelEnabled);
9441
+ * }
9442
+ * ```
9443
+ */
9444
+ /** {en}
9445
+ * @brief Get HLS Level state for the current playback session.
9446
+ * @list Api
9447
+ * @returns An HLS Level state snapshot including readiness, active and manual Levels, and the automatic Level cap.
9448
+ * @notes The `READY` event does not mean the Level list is ready. Check `ready` or listen for `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
+ getHlsLevelState(): IHlsLevelState;
9458
+ /** {zh}
9459
+ * @brief 手动切换当前 Master M3U8 的 HLS Level。
9460
+ * @list Api
9461
+ * @param levelIndex 目标 Level 索引,可通过 `getHlsLevels()` 获取。
9462
+ * @param options 切换模式和可选的播放会话 ID。
9463
+ * @notes 调用后进入手动选档。目标提交时触发 `HLS_LEVEL_SWITCHING`,实际生效后触发 `HLS_LEVEL_SWITCHED`。Manifest 未就绪、内核不支持、索引越界或会话过期时抛出 {@link HlsControlError}。
9464
+ * @example
9465
+ * ``` javascript
9466
+ * const state = playerSdkIns.getHlsLevelState();
9467
+ * playerSdkIns.setHlsLevel(1, {
9468
+ * mode: 'next-fragment',
9469
+ * playbackSessionId: state.playbackSessionId
9470
+ * });
9471
+ * ```
9472
+ */
9473
+ /** {en}
9474
+ * @brief Manually switch the HLS Level in the current Master M3U8.
9475
+ * @list Api
9476
+ * @param levelIndex Target Level index from `getHlsLevels()`.
9477
+ * @param options Switching mode and optional playback session ID.
9478
+ * @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.
9479
+ * @example
9480
+ * ``` javascript
9481
+ * const state = playerSdkIns.getHlsLevelState();
9482
+ * playerSdkIns.setHlsLevel(1, {
9483
+ * mode: 'next-fragment',
9484
+ * playbackSessionId: state.playbackSessionId
9485
+ * });
9486
+ * ```
9487
+ */
9488
+ setHlsLevel(levelIndex: number, options?: IHlsLevelSwitchOptions): void;
9489
+ /** {zh}
9490
+ * @brief 获取当前播放会话的 HLS ABR 引擎、模式、可用性和控制能力。
9491
+ * @list Api
9492
+ * @returns 当前 HLS ABR 状态快照。
9493
+ * @notes `engine` 是实际解析出的决策引擎;`configuredEngine` 只表示已生效的显式配置。请使用 `decisionSource` 决定清晰度 UI 展示 Level 还是 Definition。
9494
+ * @example
9495
+ * ``` javascript
9496
+ * const state = playerSdkIns.getHlsAbrState();
9497
+ * console.log(state.engine, state.mode, state.decisionSource);
9498
+ * ```
9499
+ */
9500
+ /** {en}
9501
+ * @brief Get the HLS ABR engine, mode, availability, and capabilities for the current playback session.
9502
+ * @list Api
9503
+ * @returns The current HLS ABR state snapshot.
9504
+ * @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.
9505
+ * @example
9506
+ * ``` javascript
9507
+ * const state = playerSdkIns.getHlsAbrState();
9508
+ * console.log(state.engine, state.mode, state.decisionSource);
9509
+ * ```
9510
+ */
9511
+ getHlsAbrState(): IHlsAbrState;
9512
+ /** {zh}
9513
+ * @brief 设置当前播放会话的 HLS ABR 自动或手动模式。
9514
+ * @list Api
9515
+ * @param mode ABR 模式。
9516
+ * @notes 设置为 `auto` 时恢复当前已解析出的 ABR 引擎,不保证固定使用 hls.js。设置为 `manual` 本身不选择档位,需配合 `setHlsLevel()` 或 Definition API。
9517
+ * @example
9518
+ * ``` javascript
9519
+ * playerSdkIns.setHlsAbrMode('auto');
9520
+ * ```
9521
+ */
9522
+ /** {en}
9523
+ * @brief Set automatic or manual HLS ABR mode for the current playback session.
9524
+ * @list Api
9525
+ * @param mode ABR mode.
9526
+ * @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.
9527
+ * @example
9528
+ * ``` javascript
9529
+ * playerSdkIns.setHlsAbrMode('auto');
9530
+ * ```
9531
+ */
9532
+ setHlsAbrMode(mode: HlsAbrMode): void;
9533
+ /** {zh}
9534
+ * @brief 获取当前播放会话已设置的 HLS ABR 上限。
9535
+ * @list Api
9536
+ * @returns 当前上限的副本;未设置时返回 `null`。
9537
+ * @example
9538
+ * ``` javascript
9539
+ * console.log(playerSdkIns.getHlsAbrLimit());
9540
+ * ```
9541
+ */
9542
+ /** {en}
9543
+ * @brief Get the HLS ABR limit configured for the current playback session.
9544
+ * @list Api
9545
+ * @returns A copy of the current limit, or `null` when no limit is set.
9546
+ * @example
9547
+ * ``` javascript
9548
+ * console.log(playerSdkIns.getHlsAbrLimit());
9549
+ * ```
9550
+ */
9551
+ getHlsAbrLimit(): IHlsAbrLimit;
9552
+ /** {zh}
9553
+ * @brief 设置或清除当前播放会话的 HLS ABR 上限。
9554
+ * @list Api
9555
+ * @param limit Level、码率或 Definition 上限;传入 `null` 清除上限。
9556
+ * @notes 是否支持某种上限取决于 `getHlsAbrState().capabilities`;无法安全映射时抛出 {@link HlsControlError},原上限保持不变。
9557
+ * @example
9558
+ * ``` javascript
9559
+ * playerSdkIns.setHlsAbrLimit({ type: 'bitrate', maxBitrate: 2500000 });
9560
+ * ```
9561
+ */
9562
+ /** {en}
9563
+ * @brief Set or clear the HLS ABR limit for the current playback session.
9564
+ * @list Api
9565
+ * @param limit A Level, bitrate, or Definition cap. Pass `null` to clear it.
9566
+ * @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.
9567
+ * @example
9568
+ * ``` javascript
9569
+ * playerSdkIns.setHlsAbrLimit({ type: 'bitrate', maxBitrate: 2500000 });
9570
+ * ```
9571
+ */
9572
+ setHlsAbrLimit(limit: IHlsAbrLimit): void;
8624
9573
  /** {zh}
8625
9574
  * @brief 获取音频轨道列表。HLS 流通过 hls.js 获取,iOS 原生播放通过 HTMLMediaElement.audioTracks 获取。
8626
9575
  * @notes 每项包含 `id`、`name`、`lang`、`channels`、`default`、`selected` 字段;轨道数量 ≤ 1 时返回空数组。
@@ -8896,16 +9845,51 @@ declare class VePlayer {
8896
9845
  */
8897
9846
  getPlugin(pluginName: string): null | BasePlugin;
8898
9847
  /** {zh}
8899
- * @brief 获取字幕列表。需配置 `Subtitle` 插件后调用。
8900
- * @return 当前字幕列表,每项包含 `id`、`language`、`text`(显示名称)等字段。列表为空时返回空数组。
8901
- * @memberof VePlayer
9848
+ * @brief 获取当前字幕列表。
9849
+ * @list Api
9850
+ * @returns 当前字幕列表的副本;未注册 `Subtitle` 插件或列表未就绪时返回空数组。
9851
+ * @notes Master M3U8 字幕项的 `source` 为 `hls`,不包含播放地址或底层轨道索引;业务显式配置的非空字幕列表优先。
9852
+ * @example
9853
+ * ``` javascript
9854
+ * const subtitles = playerSdkIns.getSubtitleList();
9855
+ * console.log(subtitles.map(item => item.text));
9856
+ * ```
9857
+ */
9858
+ /** {en}
9859
+ * @brief Get the current subtitle list.
9860
+ * @list Api
9861
+ * @returns A copy of the current subtitle list, or an empty array when the `Subtitle` plugin is unavailable or the list is not ready.
9862
+ * @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.
9863
+ * @example
9864
+ * ``` javascript
9865
+ * const subtitles = playerSdkIns.getSubtitleList();
9866
+ * console.log(subtitles.map(item => item.text));
9867
+ * ```
8902
9868
  */
8903
9869
  getSubtitleList(): ISubTitleItem[];
8904
9870
  /** {zh}
8905
- * @brief 切换字幕。需配置 `Subtitle` 插件后调用。
8906
- * @param subtitle 目标字幕的 id 或 language,任意一个非空即可定位字幕项。
8907
- * @return 切换成功时 resolve,失败(未找到、切换被中止)时 reject。
8908
- * @memberof VePlayer
9871
+ * @brief 切换当前字幕轨。
9872
+ * @list Api
9873
+ * @param subtitle 目标字幕的 `id` 或 `language`。优先精确匹配 `id`;仅按语言切换时必须唯一。
9874
+ * @returns 切换成功时 resolve;未找到、语言不唯一、切换超时或播放会话失效时 reject。
9875
+ * @notes hls.js 模式下,Promise 在播放内核确认目标字幕轨后才 resolve。
9876
+ * @example
9877
+ * ``` javascript
9878
+ * const [subtitle] = playerSdkIns.getSubtitleList();
9879
+ * if (subtitle) await playerSdkIns.switchSubtitle({ id: subtitle.id });
9880
+ * ```
9881
+ */
9882
+ /** {en}
9883
+ * @brief Switch the active subtitle track.
9884
+ * @list Api
9885
+ * @param subtitle Target subtitle `id` or `language`. Exact `id` matching takes precedence; a language-only match must be unique.
9886
+ * @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.
9887
+ * @notes In hls.js mode, the Promise resolves only after the playback engine confirms the target subtitle track.
9888
+ * @example
9889
+ * ``` javascript
9890
+ * const [subtitle] = playerSdkIns.getSubtitleList();
9891
+ * if (subtitle) await playerSdkIns.switchSubtitle({ id: subtitle.id });
9892
+ * ```
8909
9893
  */
8910
9894
  switchSubtitle(subtitle: {
8911
9895
  id?: string | number;
@@ -8913,12 +9897,36 @@ declare class VePlayer {
8913
9897
  }): Promise<void>;
8914
9898
  /** {zh}
8915
9899
  * @brief 开启字幕展示。恢复上次选中的字幕项;若从未选中过则默认选第一项。需配置 `Subtitle` 插件后调用。
8916
- * @memberof VePlayer
9900
+ * @list Api
9901
+ * @example
9902
+ * ``` javascript
9903
+ * playerSdkIns.showSubtitle();
9904
+ * ```
9905
+ */
9906
+ /** {en}
9907
+ * @brief Show subtitles by restoring the last selected item, or the first item when none has been selected. Requires the `Subtitle` plugin.
9908
+ * @list Api
9909
+ * @example
9910
+ * ``` javascript
9911
+ * playerSdkIns.showSubtitle();
9912
+ * ```
8917
9913
  */
8918
9914
  showSubtitle(): void;
8919
9915
  /** {zh}
8920
9916
  * @brief 关闭字幕展示。字幕数据保留,可通过 `showSubtitle` 重新开启。需配置 `Subtitle` 插件后调用。
8921
- * @memberof VePlayer
9917
+ * @list Api
9918
+ * @example
9919
+ * ``` javascript
9920
+ * playerSdkIns.hideSubtitle();
9921
+ * ```
9922
+ */
9923
+ /** {en}
9924
+ * @brief Hide subtitles while retaining subtitle data so it can be restored with `showSubtitle`. Requires the `Subtitle` plugin.
9925
+ * @list Api
9926
+ * @example
9927
+ * ``` javascript
9928
+ * playerSdkIns.hideSubtitle();
9929
+ * ```
8922
9930
  */
8923
9931
  hideSubtitle(): void;
8924
9932
  /** {zh}
@@ -9086,12 +10094,21 @@ export declare class LiveSubtitlesIconPlugin extends Plugin {
9086
10094
  destroy(): void;
9087
10095
  render(): string;
9088
10096
  }
10097
+ export declare type NativeSubTitleOptions = {
10098
+ nativeRenderMode?: "system" | "dom";
10099
+ container?: HTMLElement;
10100
+ style?: ISubtitleStyle;
10101
+ playbackSessionId?: string;
10102
+ emit?: (event: string, payload: unknown) => void;
10103
+ createOpaqueId?: () => string;
10104
+ };
9089
10105
  declare class NativeSubTitle extends EventEmitter {
9090
10106
  _media: any;
9091
10107
  _list: any[];
9092
10108
  _languages: string;
9093
10109
  curIndex: number;
9094
- constructor(media: any);
10110
+ private _domAdapter?;
10111
+ constructor(media: any, options?: NativeSubTitleOptions);
9095
10112
  _init(): void;
9096
10113
  _onChange: (e: any) => void;
9097
10114
  /**
@@ -9105,6 +10122,8 @@ declare class NativeSubTitle extends EventEmitter {
9105
10122
  switch(data: any): Promise<unknown>;
9106
10123
  switchOff(): void;
9107
10124
  destroy(): void;
10125
+ refresh(): void;
10126
+ setPlaybackSessionId(playbackSessionId: string): void;
9108
10127
  }
9109
10128
  export interface IPanelItem {
9110
10129
  showText: string;
@@ -9136,6 +10155,7 @@ export declare class Subtitle extends Plugin {
9136
10155
  };
9137
10156
  isShowIcon: boolean;
9138
10157
  mode: string;
10158
+ nativeRenderMode: string;
9139
10159
  updateMode: string;
9140
10160
  };
9141
10161
  private _delegates;
@@ -9148,6 +10168,11 @@ export declare class Subtitle extends Plugin {
9148
10168
  player: Player & {
9149
10169
  _subTitles?: NativeSubTitle | SubTitles;
9150
10170
  };
10171
+ private _hideListTimer;
10172
+ private _optionListEnterHandler?;
10173
+ private _optionListLeaveHandler?;
10174
+ private _runtimeSubtitleSource;
10175
+ private _runtimeSubtitleBridge?;
9151
10176
  afterCreate(): void;
9152
10177
  /**
9153
10178
  * @description 初始化原生字幕
@@ -9159,6 +10184,7 @@ export declare class Subtitle extends Plugin {
9159
10184
  * @param {number} defaultIndex
9160
10185
  */
9161
10186
  _initExtSubTitle(defaultIndex: any): void;
10187
+ private protectExtSubtitleCoreEvents;
9162
10188
  _renderList(defaultIndex: any): void;
9163
10189
  _onOff: () => void;
9164
10190
  _onChange: (data: any) => void;
@@ -9166,15 +10192,30 @@ export declare class Subtitle extends Plugin {
9166
10192
  updateCurItem(cIndex: any, subtitle: any): void;
9167
10193
  initEvents(): void;
9168
10194
  handleButtonChange: (e: any) => void;
10195
+ private runUiSubtitleAction;
9169
10196
  onEnter: (e: any) => void;
9170
10197
  onLeave: (e: any) => void;
10198
+ private clearPendingListHide;
10199
+ private scheduleListHide;
10200
+ private bindOptionListHoverEvents;
10201
+ private unbindOptionListHoverEvents;
9171
10202
  showList(): void;
9172
10203
  hideList(): void;
9173
10204
  openSubtitle(): Promise<any>;
9174
- getSubTitleIndex(list: any, subtitle?: {
9175
- id: string;
9176
- language: string;
9177
- }): number;
10205
+ getSubTitleIndex(list: ISubTitleItem[], subtitle?: Pick<ISubTitleItem, "id" | "language">): number;
10206
+ setRuntimeSubtitleSource(source: "config" | "hls"): void;
10207
+ setRuntimeSubtitleBridge(bridge?: {
10208
+ switchSubtitle: (subtitle: {
10209
+ id?: string | number;
10210
+ language?: string | number;
10211
+ }) => Promise<void>;
10212
+ hide: () => void;
10213
+ show: () => Promise<void>;
10214
+ }): void;
10215
+ replaceRuntimeSubtitleList(list: ISubTitleItem[], isOpen: boolean): void;
10216
+ confirmRuntimeSubtitleSelection(item: ISubTitleItem | null): void;
10217
+ syncRuntimeSubtitleRenderer(runtimeIndex: number): void;
10218
+ clearRuntimeSubtitleView(): void;
9178
10219
  registerIcons(): {
9179
10220
  vttSubOpen: {
9180
10221
  icon: string;
@@ -9205,6 +10246,7 @@ export declare class Subtitle extends Plugin {
9205
10246
  "zh-hk": string;
9206
10247
  };
9207
10248
  };
10249
+ updateLang(lang: string): void;
9208
10250
  creatOptionList(): void;
9209
10251
  getList(): any;
9210
10252
  renderOptionList(): void;
@@ -9673,285 +10715,55 @@ export declare const Events: {
9673
10715
  * @brief Triggered when mirror mode is enabled.
9674
10716
  */
9675
10717
  MIRROR_CHANGE: string;
9676
- /** {zh}
9677
- * @brief 播放器实例创建完成时触发。
9678
- */
9679
- /** {en}
9680
- * @brief Triggered when the player instance is created.
9681
- */
9682
- READY: string;
9683
- /** {zh}
9684
- * @brief 播放器创建 `video` 完成时触发,表示可以开始播放。
9685
- */
9686
- /** {en}
9687
- * @brief Triggered when the player has created the `video` element and playback can start.
9688
- */
9689
- COMPLETE: string;
9690
- /** {zh}
9691
- * @brief 播放资源发生变化。
9692
- */
9693
- /** {en}
9694
- * @brief Triggered when the playback resource changes.
9695
- */
9696
- URL_CHANGE: string;
9697
- /** {zh}
9698
- * @brief 播放器聚焦,同时会展示 Control 栏控件,包含播放按钮、进度条等。
9699
- */
9700
- /** {en}
9701
- * @brief Triggered when the player gains focus; the control bar is shown.
9702
- */
9703
- PLAYER_FOCUS: string;
9704
- /** {zh}
9705
- * @brief 播放器失焦,同时会隐藏 Control 栏控件,包含播放按钮、进度条等。
9706
- */
9707
- /** {en}
9708
- * @brief Triggered when the player loses focus; the control bar is hidden.
9709
- */
9710
- PLAYER_BLUR: string;
9711
- /** {zh}
9712
- * @brief 系统全屏状态切换。
9713
- */
9714
- /** {en}
9715
- * @brief Triggered when native fullscreen state changes.
9716
- */
9717
- FULLSCREEN_CHANGE: string;
9718
- /** {zh}
9719
- * @brief 网页全屏状态切换。
9720
- */
9721
- /** {en}
9722
- * @brief Triggered when CSS fullscreen state changes.
9723
- */
9724
- CSS_FULLSCREEN_CHANGE: string;
9725
- /** {zh}
9726
- * @brief 画中画模式切换。
9727
- */
9728
- /** {en}
9729
- * @brief Triggered when mini player (floating) mode changes.
9730
- */
9731
- MINI_STATE_CHANGE: string;
9732
- /** {zh}
9733
- * @brief 播放器销毁。
9734
- */
9735
- /** {en}
9736
- * @brief Triggered when the player is destroyed.
9737
- */
9738
- DESTROY: string;
9739
- /** {zh}
9740
- * @brief 播放器重新播放。
9741
- */
9742
- /** {en}
9743
- * @brief Triggered when replay starts.
9744
- */
9745
- REPLAY: string;
9746
- /** {zh}
9747
- * @brief 播放器重试。
9748
- */
9749
- /** {en}
9750
- * @brief Triggered when the player retries playback.
9751
- */
9752
- RETRY: string;
9753
- /** {zh}
9754
- * @brief 清晰度发生变化
9755
- */
9756
- /** {en}
9757
- * @brief Triggered when the definition (resolution) changes.
9758
- */
9759
- DEFINITION_CHANGE: string;
9760
- /** {zh}
9761
- * @hidden
9762
- */
9763
- /** {en}
9764
- * @hidden
9765
- */
9766
- Before_DEFINITION_CHANGE: string;
9767
- /** {zh}
9768
- * @hidden
9769
- */
9770
- /** {en}
9771
- * @hidden
9772
- */
9773
- AFTER_DEFINITION_CHANGE: string;
9774
- /** {zh}
9775
- * @brief 播放器容器尺寸发生变化。
9776
- */
9777
- /** {en}
9778
- * @brief Triggered when the player container size changes.
9779
- */
9780
- VIDEO_RESIZE: string;
9781
- /** {zh}
9782
- * @brief 画中画状态切换。
9783
- */
9784
- /** {en}
9785
- * @brief Triggered when Picture-in-Picture state changes.
9786
- */
9787
- PIP_CHANGE: string;
9788
- /** {zh}
9789
- * @brief 播放器发生旋转。
9790
- */
9791
- /** {en}
9792
- * @brief Triggered when the player is rotated.
9793
- */
9794
- ROTATE: string;
9795
- /** {zh}
9796
- * @brief 播放器内置快捷键事件被触发。
9797
- */
9798
- /** {en}
9799
- * @brief Triggered when a built-in keyboard shortcut is used.
9800
- */
9801
- SHORTCUT: string;
9802
- /** {zh}
9803
- * @deprecated
9804
- * @brief (已废弃)SEI 信息解析。
9805
- */
9806
- /** {en}
9807
- * @deprecated
9808
- * @brief (Deprecated) SEI information parsing.
9809
- */
9810
- SEI_PARSED: string;
9811
- /** {zh}
9812
- * @brief 内置插件用户行为触发。所有内置插件用户行为交互都会下发该事件,可用于用户行为埋点。
9813
- */
9814
- /** {en}
9815
- * @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.
9816
- */
9817
- USER_ACTION: string;
9818
- /** {zh}
9819
- * @brief 自动播放成功时触发。
9820
- */
9821
- /** {en}
9822
- * @brief Triggered when autoplay succeeds.
9823
- */
9824
- AUTOPLAY_STARTED: string;
9825
- /** {zh}
9826
- * @brief 自动播放失败时触发。
9827
- */
9828
- /** {en}
9829
- * @brief Triggered when autoplay fails.
9830
- */
9831
- AUTOPLAY_PREVENTED: string;
9832
- /** {zh}
9833
- * @brief 播放器准备创建。
9834
- */
9835
- READY_CREATE_PLAYER: string;
9836
- /** {zh}
9837
- * @brief 播放器完成创建。
9838
- */
9839
- /** {en}
9840
- * @brief Triggered when player creation completes.
9841
- */
9842
- PLAYER_CREATED_FINISH: string;
9843
- /** {zh}
9844
- * @brief createPlayer 性能报告。与 `PLAYER_CREATED_FINISH` 几乎同时触发(略早)。
9845
- */
9846
- /** {en}
9847
- * @brief createPlayer performance report. Fired almost at the same time as `PLAYER_CREATED_FINISH` (slightly earlier).
9848
- */
9849
- CREATE_PLAYER_PERF: string;
9850
- /** {zh}
9851
- * @brief 播放器重建。
9852
- */
9853
- /** {en}
9854
- * @brief Triggered when the player is rebuilt.
9855
- */
9856
- PLAYER_REBUILD: string;
9857
- /** {zh}
9858
- * @brief 硬解不支持时触发。
9859
- */
9860
- /** {en}
9861
- * @brief Triggered when hardware decoding is not supported.
9862
- */
9863
- NOT_SUPPORT_HARDWARE_DECODER: string;
9864
- /** {zh}
9865
- * @brief 软解不支持时触发。
9866
- */
9867
- /** {en}
9868
- * @brief Triggered when software decoding is not supported.
9869
- */
9870
- NOT_SUPPORT_SOFT_DECODER: string;
9871
- /** {zh}
9872
- * @brief `playAuthToken` 过期。
9873
- */
9874
- /** {en}
9875
- * @brief Triggered when `playAuthToken` expires.
9876
- */
9877
- TOKEN_EXPIRED: string;
9878
- /** {zh}
9879
- * @brief UMD 加载失败。
9880
- */
9881
- /** {en}
9882
- * @brief Triggered when UMD loading fails.
9883
- */
9884
- UMD_LOAD_FAIL: string;
9885
- /** {zh}
9886
- * @brief 切换下一个视频。调用 `playNext` 后触发。
9887
- */
9888
- /** {en}
9889
- * @brief Triggered when switching to the next video, after calling `playNext`.
9890
- */
9891
- PLAYNEXT: string;
9892
- /** {zh}
9893
- * @brief 视频地址为空。
9894
- */
9895
- /** {en}
9896
- * @brief Triggered when the video URL is empty.
9897
- */
9898
- URL_NULL: string;
9899
- /** {zh}
9900
- * @brief 鼠标移出。
9901
- */
9902
- /** {en}
9903
- * @brief Triggered when the mouse leaves the player.
9904
- */
9905
- LEAVE_PLAYER: string;
9906
- /** {zh}
9907
- * @brief 鼠标移入。
9908
- */
9909
- /** {en}
9910
- * @brief Triggered when the mouse enters the player.
9911
- */
9912
- ENTER_PLAYER: string;
9913
- /** {zh}
9914
- * @brief 播放器状态重置。
9915
- */
9916
- /** {en}
9917
- * @brief Triggered when the player state is reset.
9918
- */
9919
- RESET: string;
9920
- /** {zh}
9921
- * @brief `<source>` 加载错误,表示 `<source>` 不支持或播放失败。
9922
- */
9923
- /** {en}
9924
- * @brief Triggered when a `<source>` fails to load (unsupported or playback failed).
9925
- */
9926
- SOURCE_ERROR: string;
9927
- /** {zh}
9928
- * @brief `<source>` 加载成功。
9929
- */
9930
- /** {en}
9931
- * @brief Triggered when a `<source>` loads successfully.
9932
- */
9933
- SOURCE_SUCCESS: string;
9934
- /** {zh}
9935
- * @brief license 提醒
9936
- */
9937
- /** {en}
9938
- * @brief License status warning.
9939
- */
9940
- LICENSE_STATUS_WARNING: string;
9941
- /** {zh}
9942
- * @brief HLS 音频轨道列表更新时触发。`data.audioTracks` 为完整轨道数组。
9943
- */
9944
- /** {en}
9945
- * @brief Triggered when the HLS audio track list updates. `data.audioTracks` is the full track array.
9946
- */
9947
- AUDIO_TRACKS_UPDATED: string;
9948
- /** {zh}
9949
- * @brief 音频轨道切换完成时触发。`data.id` 为新轨道 id,`data.audioTrack` 为完整轨道对象。
9950
- */
9951
- /** {en}
9952
- * @brief Triggered when audio track switching completes. `data.id` is the new track id; `data.audioTrack` is the full track object.
9953
- */
9954
- AUDIO_TRACK_CHANGE: string;
10718
+ READY: "ready";
10719
+ COMPLETE: "complete";
10720
+ URL_CHANGE: "urlchange";
10721
+ PLAYER_FOCUS: "focus";
10722
+ PLAYER_BLUR: "blur";
10723
+ FULLSCREEN_CHANGE: "fullscreen_change";
10724
+ CSS_FULLSCREEN_CHANGE: "cssFullscreen_change";
10725
+ MINI_STATE_CHANGE: "mini_state_change";
10726
+ DESTROY: "destroy";
10727
+ REPLAY: "replay";
10728
+ RETRY: "retry";
10729
+ DEFINITION_CHANGE: "definition_change";
10730
+ Before_DEFINITION_CHANGE: "before_definition_change";
10731
+ AFTER_DEFINITION_CHANGE: "after_definition_change";
10732
+ VIDEO_RESIZE: "video_resize";
10733
+ PIP_CHANGE: "pip_change";
10734
+ ROTATE: "rotate";
10735
+ SHORTCUT: "shortcut";
10736
+ SEI_PARSED: "SEI_PARSED";
10737
+ USER_ACTION: "user_action";
10738
+ AUTOPLAY_STARTED: "autoplay_started";
10739
+ AUTOPLAY_PREVENTED: "autoplay_was_prevented";
10740
+ READY_CREATE_PLAYER: "ready_create_player";
10741
+ PLAYER_CREATED_FINISH: "player_create_finish";
10742
+ CREATE_PLAYER_PERF: "create_player_perf";
10743
+ PLAYER_REBUILD: "player_rebuild";
10744
+ NOT_SUPPORT_HARDWARE_DECODER: "not_support_hardware_decoder";
10745
+ NOT_SUPPORT_SOFT_DECODER: "not_support_soft_decoder";
10746
+ TOKEN_EXPIRED: "playAuthToken_expired";
10747
+ UMD_LOAD_FAIL: "umd_load_fail";
10748
+ PLAYNEXT: "playnext";
10749
+ URL_NULL: "urlNull";
10750
+ LEAVE_PLAYER: "leaveplayer";
10751
+ ENTER_PLAYER: "enterplayer";
10752
+ RESET: "reset";
10753
+ SOURCE_ERROR: "source_error";
10754
+ SOURCE_SUCCESS: "source_success";
10755
+ LICENSE_STATUS_WARNING: "license_status_warning";
10756
+ AUDIO_TRACKS_UPDATED: "audio_tracks_updated";
10757
+ AUDIO_TRACK_CHANGE: "audio_track_change";
10758
+ HLS_LEVELS_UPDATED: "hls_levels_updated";
10759
+ HLS_LEVEL_SWITCHING: "hls_level_switching";
10760
+ HLS_LEVEL_SWITCHED: "hls_level_switched";
10761
+ HLS_ABR_ENGINE_RESOLVED: "hls_abr_engine_resolved";
10762
+ HLS_ABR_STATE_CHANGE: "hls_abr_state_change";
10763
+ HLS_ABR_LIMIT_CHANGE: "hls_abr_limit_change";
10764
+ HLS_SUBTITLE_TRACKS_UPDATED: "hls_subtitle_tracks_updated";
10765
+ HLS_SUBTITLE_TRACK_SWITCHING: "hls_subtitle_track_switching";
10766
+ HLS_SUBTITLE_TRACK_SWITCHED: "hls_subtitle_track_switched";
9955
10767
  /** {zh}
9956
10768
  * @brief 在播放被终止时触发。例如当播放中的视频重新开始播放。
9957
10769
  */
@@ -10124,126 +10936,126 @@ export declare const Event: {
10124
10936
  /** {en}
10125
10937
  * @brief Triggered when the player instance is created.
10126
10938
  */
10127
- READY: string;
10939
+ readonly READY: "ready";
10128
10940
  /** {zh}
10129
10941
  * @brief 播放器创建 `video` 完成时触发,表示可以开始播放。
10130
10942
  */
10131
10943
  /** {en}
10132
10944
  * @brief Triggered when the player has created the `video` element and playback can start.
10133
10945
  */
10134
- COMPLETE: string;
10946
+ readonly COMPLETE: "complete";
10135
10947
  /** {zh}
10136
10948
  * @brief 播放资源发生变化。
10137
10949
  */
10138
10950
  /** {en}
10139
10951
  * @brief Triggered when the playback resource changes.
10140
10952
  */
10141
- URL_CHANGE: string;
10953
+ readonly URL_CHANGE: "urlchange";
10142
10954
  /** {zh}
10143
10955
  * @brief 播放器聚焦,同时会展示 Control 栏控件,包含播放按钮、进度条等。
10144
10956
  */
10145
10957
  /** {en}
10146
10958
  * @brief Triggered when the player gains focus; the control bar is shown.
10147
10959
  */
10148
- PLAYER_FOCUS: string;
10960
+ readonly PLAYER_FOCUS: "focus";
10149
10961
  /** {zh}
10150
10962
  * @brief 播放器失焦,同时会隐藏 Control 栏控件,包含播放按钮、进度条等。
10151
10963
  */
10152
10964
  /** {en}
10153
10965
  * @brief Triggered when the player loses focus; the control bar is hidden.
10154
10966
  */
10155
- PLAYER_BLUR: string;
10967
+ readonly PLAYER_BLUR: "blur";
10156
10968
  /** {zh}
10157
10969
  * @brief 系统全屏状态切换。
10158
10970
  */
10159
10971
  /** {en}
10160
10972
  * @brief Triggered when native fullscreen state changes.
10161
10973
  */
10162
- FULLSCREEN_CHANGE: string;
10974
+ readonly FULLSCREEN_CHANGE: "fullscreen_change";
10163
10975
  /** {zh}
10164
10976
  * @brief 网页全屏状态切换。
10165
10977
  */
10166
10978
  /** {en}
10167
10979
  * @brief Triggered when CSS fullscreen state changes.
10168
10980
  */
10169
- CSS_FULLSCREEN_CHANGE: string;
10981
+ readonly CSS_FULLSCREEN_CHANGE: "cssFullscreen_change";
10170
10982
  /** {zh}
10171
10983
  * @brief 画中画模式切换。
10172
10984
  */
10173
10985
  /** {en}
10174
10986
  * @brief Triggered when mini player (floating) mode changes.
10175
10987
  */
10176
- MINI_STATE_CHANGE: string;
10988
+ readonly MINI_STATE_CHANGE: "mini_state_change";
10177
10989
  /** {zh}
10178
10990
  * @brief 播放器销毁。
10179
10991
  */
10180
10992
  /** {en}
10181
10993
  * @brief Triggered when the player is destroyed.
10182
10994
  */
10183
- DESTROY: string;
10995
+ readonly DESTROY: "destroy";
10184
10996
  /** {zh}
10185
10997
  * @brief 播放器重新播放。
10186
10998
  */
10187
10999
  /** {en}
10188
11000
  * @brief Triggered when replay starts.
10189
11001
  */
10190
- REPLAY: string;
11002
+ readonly REPLAY: "replay";
10191
11003
  /** {zh}
10192
11004
  * @brief 播放器重试。
10193
11005
  */
10194
11006
  /** {en}
10195
11007
  * @brief Triggered when the player retries playback.
10196
11008
  */
10197
- RETRY: string;
11009
+ readonly RETRY: "retry";
10198
11010
  /** {zh}
10199
11011
  * @brief 清晰度发生变化
10200
11012
  */
10201
11013
  /** {en}
10202
11014
  * @brief Triggered when the definition (resolution) changes.
10203
11015
  */
10204
- DEFINITION_CHANGE: string;
11016
+ readonly DEFINITION_CHANGE: "definition_change";
10205
11017
  /** {zh}
10206
11018
  * @hidden
10207
11019
  */
10208
11020
  /** {en}
10209
11021
  * @hidden
10210
11022
  */
10211
- Before_DEFINITION_CHANGE: string;
11023
+ readonly Before_DEFINITION_CHANGE: "before_definition_change";
10212
11024
  /** {zh}
10213
11025
  * @hidden
10214
11026
  */
10215
11027
  /** {en}
10216
11028
  * @hidden
10217
11029
  */
10218
- AFTER_DEFINITION_CHANGE: string;
11030
+ readonly AFTER_DEFINITION_CHANGE: "after_definition_change";
10219
11031
  /** {zh}
10220
11032
  * @brief 播放器容器尺寸发生变化。
10221
11033
  */
10222
11034
  /** {en}
10223
11035
  * @brief Triggered when the player container size changes.
10224
11036
  */
10225
- VIDEO_RESIZE: string;
11037
+ readonly VIDEO_RESIZE: "video_resize";
10226
11038
  /** {zh}
10227
11039
  * @brief 画中画状态切换。
10228
11040
  */
10229
11041
  /** {en}
10230
11042
  * @brief Triggered when Picture-in-Picture state changes.
10231
11043
  */
10232
- PIP_CHANGE: string;
11044
+ readonly PIP_CHANGE: "pip_change";
10233
11045
  /** {zh}
10234
11046
  * @brief 播放器发生旋转。
10235
11047
  */
10236
11048
  /** {en}
10237
11049
  * @brief Triggered when the player is rotated.
10238
11050
  */
10239
- ROTATE: string;
11051
+ readonly ROTATE: "rotate";
10240
11052
  /** {zh}
10241
11053
  * @brief 播放器内置快捷键事件被触发。
10242
11054
  */
10243
11055
  /** {en}
10244
11056
  * @brief Triggered when a built-in keyboard shortcut is used.
10245
11057
  */
10246
- SHORTCUT: string;
11058
+ readonly SHORTCUT: "shortcut";
10247
11059
  /** {zh}
10248
11060
  * @deprecated
10249
11061
  * @brief (已废弃)SEI 信息解析。
@@ -10252,151 +11064,214 @@ export declare const Event: {
10252
11064
  * @deprecated
10253
11065
  * @brief (Deprecated) SEI information parsing.
10254
11066
  */
10255
- SEI_PARSED: string;
11067
+ readonly SEI_PARSED: "SEI_PARSED";
10256
11068
  /** {zh}
10257
11069
  * @brief 内置插件用户行为触发。所有内置插件用户行为交互都会下发该事件,可用于用户行为埋点。
10258
11070
  */
10259
11071
  /** {en}
10260
11072
  * @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.
10261
11073
  */
10262
- USER_ACTION: string;
11074
+ readonly USER_ACTION: "user_action";
10263
11075
  /** {zh}
10264
11076
  * @brief 自动播放成功时触发。
10265
11077
  */
10266
11078
  /** {en}
10267
11079
  * @brief Triggered when autoplay succeeds.
10268
11080
  */
10269
- AUTOPLAY_STARTED: string;
11081
+ readonly AUTOPLAY_STARTED: "autoplay_started";
10270
11082
  /** {zh}
10271
11083
  * @brief 自动播放失败时触发。
10272
11084
  */
10273
11085
  /** {en}
10274
11086
  * @brief Triggered when autoplay fails.
10275
11087
  */
10276
- AUTOPLAY_PREVENTED: string;
11088
+ readonly AUTOPLAY_PREVENTED: "autoplay_was_prevented";
10277
11089
  /** {zh}
10278
11090
  * @brief 播放器准备创建。
10279
11091
  */
10280
- READY_CREATE_PLAYER: string;
11092
+ readonly READY_CREATE_PLAYER: "ready_create_player";
10281
11093
  /** {zh}
10282
11094
  * @brief 播放器完成创建。
10283
11095
  */
10284
11096
  /** {en}
10285
11097
  * @brief Triggered when player creation completes.
10286
11098
  */
10287
- PLAYER_CREATED_FINISH: string;
11099
+ readonly PLAYER_CREATED_FINISH: "player_create_finish";
10288
11100
  /** {zh}
10289
11101
  * @brief createPlayer 性能报告。与 `PLAYER_CREATED_FINISH` 几乎同时触发(略早)。
10290
11102
  */
10291
11103
  /** {en}
10292
11104
  * @brief createPlayer performance report. Fired almost at the same time as `PLAYER_CREATED_FINISH` (slightly earlier).
10293
11105
  */
10294
- CREATE_PLAYER_PERF: string;
11106
+ readonly CREATE_PLAYER_PERF: "create_player_perf";
10295
11107
  /** {zh}
10296
11108
  * @brief 播放器重建。
10297
11109
  */
10298
11110
  /** {en}
10299
11111
  * @brief Triggered when the player is rebuilt.
10300
11112
  */
10301
- PLAYER_REBUILD: string;
11113
+ readonly PLAYER_REBUILD: "player_rebuild";
10302
11114
  /** {zh}
10303
11115
  * @brief 硬解不支持时触发。
10304
11116
  */
10305
11117
  /** {en}
10306
11118
  * @brief Triggered when hardware decoding is not supported.
10307
11119
  */
10308
- NOT_SUPPORT_HARDWARE_DECODER: string;
11120
+ readonly NOT_SUPPORT_HARDWARE_DECODER: "not_support_hardware_decoder";
10309
11121
  /** {zh}
10310
11122
  * @brief 软解不支持时触发。
10311
11123
  */
10312
11124
  /** {en}
10313
11125
  * @brief Triggered when software decoding is not supported.
10314
11126
  */
10315
- NOT_SUPPORT_SOFT_DECODER: string;
11127
+ readonly NOT_SUPPORT_SOFT_DECODER: "not_support_soft_decoder";
10316
11128
  /** {zh}
10317
11129
  * @brief `playAuthToken` 过期。
10318
11130
  */
10319
11131
  /** {en}
10320
11132
  * @brief Triggered when `playAuthToken` expires.
10321
11133
  */
10322
- TOKEN_EXPIRED: string;
11134
+ readonly TOKEN_EXPIRED: "playAuthToken_expired";
10323
11135
  /** {zh}
10324
11136
  * @brief UMD 加载失败。
10325
11137
  */
10326
11138
  /** {en}
10327
11139
  * @brief Triggered when UMD loading fails.
10328
11140
  */
10329
- UMD_LOAD_FAIL: string;
11141
+ readonly UMD_LOAD_FAIL: "umd_load_fail";
10330
11142
  /** {zh}
10331
11143
  * @brief 切换下一个视频。调用 `playNext` 后触发。
10332
11144
  */
10333
11145
  /** {en}
10334
11146
  * @brief Triggered when switching to the next video, after calling `playNext`.
10335
11147
  */
10336
- PLAYNEXT: string;
11148
+ readonly PLAYNEXT: "playnext";
10337
11149
  /** {zh}
10338
11150
  * @brief 视频地址为空。
10339
11151
  */
10340
11152
  /** {en}
10341
11153
  * @brief Triggered when the video URL is empty.
10342
11154
  */
10343
- URL_NULL: string;
11155
+ readonly URL_NULL: "urlNull";
10344
11156
  /** {zh}
10345
11157
  * @brief 鼠标移出。
10346
11158
  */
10347
11159
  /** {en}
10348
11160
  * @brief Triggered when the mouse leaves the player.
10349
11161
  */
10350
- LEAVE_PLAYER: string;
11162
+ readonly LEAVE_PLAYER: "leaveplayer";
10351
11163
  /** {zh}
10352
11164
  * @brief 鼠标移入。
10353
11165
  */
10354
11166
  /** {en}
10355
11167
  * @brief Triggered when the mouse enters the player.
10356
11168
  */
10357
- ENTER_PLAYER: string;
11169
+ readonly ENTER_PLAYER: "enterplayer";
10358
11170
  /** {zh}
10359
11171
  * @brief 播放器状态重置。
10360
11172
  */
10361
11173
  /** {en}
10362
11174
  * @brief Triggered when the player state is reset.
10363
11175
  */
10364
- RESET: string;
11176
+ readonly RESET: "reset";
10365
11177
  /** {zh}
10366
11178
  * @brief `<source>` 加载错误,表示 `<source>` 不支持或播放失败。
10367
11179
  */
10368
11180
  /** {en}
10369
11181
  * @brief Triggered when a `<source>` fails to load (unsupported or playback failed).
10370
11182
  */
10371
- SOURCE_ERROR: string;
11183
+ readonly SOURCE_ERROR: "source_error";
10372
11184
  /** {zh}
10373
11185
  * @brief `<source>` 加载成功。
10374
11186
  */
10375
11187
  /** {en}
10376
11188
  * @brief Triggered when a `<source>` loads successfully.
10377
11189
  */
10378
- SOURCE_SUCCESS: string;
11190
+ readonly SOURCE_SUCCESS: "source_success";
10379
11191
  /** {zh}
10380
11192
  * @brief license 提醒
10381
11193
  */
10382
11194
  /** {en}
10383
11195
  * @brief License status warning.
10384
11196
  */
10385
- LICENSE_STATUS_WARNING: string;
11197
+ readonly LICENSE_STATUS_WARNING: "license_status_warning";
10386
11198
  /** {zh}
10387
11199
  * @brief HLS 音频轨道列表更新时触发。`data.audioTracks` 为完整轨道数组。
10388
11200
  */
10389
11201
  /** {en}
10390
11202
  * @brief Triggered when the HLS audio track list updates. `data.audioTracks` is the full track array.
10391
11203
  */
10392
- AUDIO_TRACKS_UPDATED: string;
11204
+ readonly AUDIO_TRACKS_UPDATED: "audio_tracks_updated";
10393
11205
  /** {zh}
10394
11206
  * @brief 音频轨道切换完成时触发。`data.id` 为新轨道 id,`data.audioTrack` 为完整轨道对象。
10395
11207
  */
10396
11208
  /** {en}
10397
11209
  * @brief Triggered when audio track switching completes. `data.id` is the new track id; `data.audioTrack` is the full track object.
10398
11210
  */
10399
- AUDIO_TRACK_CHANGE: string;
11211
+ readonly AUDIO_TRACK_CHANGE: "audio_track_change";
11212
+ /** {zh}
11213
+ * @brief 当前播放会话的 HLS Level 列表或状态更新。
11214
+ */
11215
+ /** {en}
11216
+ * @brief Triggered when the HLS Level list or state updates for the current playback session.
11217
+ */
11218
+ readonly HLS_LEVELS_UPDATED: "hls_levels_updated";
11219
+ /** {zh}
11220
+ * @brief HLS Level 切换请求已提交给播放内核;不表示画面已经切换。
11221
+ */
11222
+ /** {en}
11223
+ * @brief Triggered after an HLS Level switch is submitted to the playback engine; the rendered Level may not have changed yet.
11224
+ */
11225
+ readonly HLS_LEVEL_SWITCHING: "hls_level_switching";
11226
+ /** {zh}
11227
+ * @brief HLS Level 已实际切换。
11228
+ */
11229
+ /** {en}
11230
+ * @brief Triggered after the active HLS Level has actually switched.
11231
+ */
11232
+ readonly HLS_LEVEL_SWITCHED: "hls_level_switched";
11233
+ /** {zh}
11234
+ * @brief 当前播放会话的 HLS ABR 决策引擎解析完成。
11235
+ */
11236
+ /** {en}
11237
+ * @brief Triggered after the HLS ABR decision engine is resolved for the current playback session.
11238
+ */
11239
+ readonly HLS_ABR_ENGINE_RESOLVED: "hls_abr_engine_resolved";
11240
+ /** {zh}
11241
+ * @brief HLS ABR 的可用性、自动/手动模式或激活状态发生变化。
11242
+ */
11243
+ /** {en}
11244
+ * @brief Triggered when HLS ABR availability, auto/manual mode, or active state changes.
11245
+ */
11246
+ readonly HLS_ABR_STATE_CHANGE: "hls_abr_state_change";
11247
+ /** {zh}
11248
+ * @brief HLS ABR 上限发生变化。
11249
+ */
11250
+ /** {en}
11251
+ * @brief Triggered when the HLS ABR cap changes.
11252
+ */
11253
+ readonly HLS_ABR_LIMIT_CHANGE: "hls_abr_limit_change";
11254
+ /** {zh}
11255
+ * @brief 当前播放会话从 Master M3U8 或原生 TextTrack 获得的字幕列表更新。
11256
+ */
11257
+ /** {en}
11258
+ * @brief Triggered when the subtitle list sourced from a Master M3U8 or native TextTracks updates for the current playback session.
11259
+ */
11260
+ readonly HLS_SUBTITLE_TRACKS_UPDATED: "hls_subtitle_tracks_updated";
11261
+ /** {zh}
11262
+ * @brief HLS 字幕轨切换请求已提交;不表示字幕轨已经生效。
11263
+ */
11264
+ /** {en}
11265
+ * @brief Triggered after an HLS subtitle-track switch is submitted; the track may not be active yet.
11266
+ */
11267
+ readonly HLS_SUBTITLE_TRACK_SWITCHING: "hls_subtitle_track_switching";
11268
+ /** {zh}
11269
+ * @brief HLS 字幕轨切换已经生效。
11270
+ */
11271
+ /** {en}
11272
+ * @brief Triggered after an HLS subtitle-track switch takes effect.
11273
+ */
11274
+ readonly HLS_SUBTITLE_TRACK_SWITCHED: "hls_subtitle_track_switched";
10400
11275
  };
10401
11276
  PluginEvents: {
10402
11277
  /** {zh}