@byteplus/veplayer 1.19.0-rc.4 → 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 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;
@@ -3194,6 +3385,19 @@ export interface ITTDramaEnv {
3194
3385
  * @type {function}
3195
3386
  */
3196
3387
  sendLog: (EventName: string, params: Record<string, any>) => void;
3388
+ /** {zh}
3389
+ * @hidden
3390
+ * @brief 当前在播短剧身份变化通知,由宿主集成层消费。
3391
+ */
3392
+ /** {en}
3393
+ * @hidden
3394
+ * @brief Notifies the host integration when the current drama playback identity changes.
3395
+ */
3396
+ onCurrentDramaPlaybackContextChange?: (context: {
3397
+ albumId: string | null;
3398
+ episodeId: string | null;
3399
+ vid: string | null;
3400
+ } | null) => boolean | void;
3197
3401
  /**
3198
3402
  * 低版本 app 下验证 TTOP 签发的 playAuthToken 时使用的密钥
3199
3403
  * 通过 JSB(如 minis.getSecret)从 Native 获取,用于 HMAC-SHA256 签名校验
@@ -3415,6 +3619,465 @@ export interface IVideoInfo {
3415
3619
  Data: IGetPlayInfoRes;
3416
3620
  };
3417
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
+ }
3418
4081
  export declare type TAPIRegionConfig = {
3419
4082
  __PLAY_DOMAIN__: string;
3420
4083
  __BACKUP_PLAY_DOMAIN__?: string;
@@ -4686,6 +5349,7 @@ export interface IPlayerConfig extends IPlayerOptions {
4686
5349
  * - **Android**:直接启用 hls.js 播放。
4687
5350
  * - **iOS**:仅在设备支持 `ManagedMediaSource`(iOS 17.1+,即 `VePlayer.isMMSSupported()` 为 `true`)时启用;
4688
5351
  * 不满足时自动回退至原生 HLS 播放。
5352
+ * - **`isMobile` 模拟模式**:当前浏览器支持 MSE 或 MMS 时启用 hls.js。
4689
5353
  * 开启后可在移动端解锁多音轨切换、`setAudioOption` 偏好持久化等 hls.js 特有能力。
4690
5354
  * @default false
4691
5355
  */
@@ -4694,10 +5358,79 @@ export interface IPlayerConfig extends IPlayerOptions {
4694
5358
  * - **Android**: always enables hls.js.
4695
5359
  * - **iOS**: enables hls.js only when `ManagedMediaSource` is supported (iOS 17.1+,
4696
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.
4697
5362
  * Unlocks hls.js-specific features such as multi-audio-track switching on mobile.
4698
5363
  * @default false
4699
5364
  */
4700
5365
  enableMobileHlsPlugin?: boolean;
5366
+ /** {zh}
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;
4701
5434
  /** {zh}
4702
5435
  * @brief 是否启用 {@link https://hlsjs.video-dev.org/ hls.js} 插件播放HLS视频,默认为true,设置为false后,PC端播放HLS使用自研hls插件播放HLS视频
4703
5436
  * @default true
@@ -6575,6 +7308,238 @@ declare abstract class AbstractBaseAdapter {
6575
7308
  abstract getPlugins(umdLoader: UMDLoader): Promise<XGPlugin[]>;
6576
7309
  abstract setPluginConfigInVid(videoInfo: IVideoInfo, context: AuthToken): void;
6577
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";
6578
7543
  declare class PlayerData {
6579
7544
  id?: string;
6580
7545
  root?: HTMLElement;
@@ -6676,6 +7641,8 @@ declare class PlayerData {
6676
7641
  */
6677
7642
  getCurrentStreamType(): string;
6678
7643
  getStreamType(): string;
7644
+ getConfiguredHlsAbrEngine(): HlsAbrEngine;
7645
+ isOpenVePlayerABR(): boolean;
6679
7646
  isOpenABR(): boolean;
6680
7647
  showRealDefinition(): boolean;
6681
7648
  isAutoDefinition(def: any): boolean;
@@ -7050,203 +8017,16 @@ export declare type IMediaInfoPrefetchFailure = {
7050
8017
  export declare type IMediaInfoPrefetchResult = IMediaInfoPrefetchSuccess | IMediaInfoPrefetchFailure;
7051
8018
  export declare type IPreloadStream = IPreloadResolvedStream | IPreloadDramaStream | IPreloadAuthTokenStream;
7052
8019
  /** {zh}
7053
- * @list Options
7054
- * @brief 字幕项。
7055
- * @kind property
8020
+ * @hidden
8021
+ * h265策略配置
8022
+ * @detail Options
7056
8023
  */
7057
8024
  /** {en}
7058
- * @list Options
7059
- * @brief Subtitle item.
7060
- * @kind property
8025
+ * @hidden
8026
+ * @brief H.265 strategy configuration.
8027
+ * @detail Options
7061
8028
  */
7062
- export interface ISubTitleItem {
7063
- /** {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 = {
8029
+ export declare type IH265Config = {
7250
8030
  /** {zh}
7251
8031
  * @brief h265策略依赖Module
7252
8032
  */
@@ -7592,6 +8372,7 @@ declare function getMediaInfoCacheConfig(): NormalizedMediaInfoCacheConfig;
7592
8372
  export interface DramaIdentity {
7593
8373
  albumId: string | null;
7594
8374
  episodeId: string | null;
8375
+ vid: string | null;
7595
8376
  }
7596
8377
  export declare type PlayerPlaybackState = "creating" | "ready" | "playing" | "paused" | "buffering" | "ended" | "error" | "destroyed";
7597
8378
  export interface PlayerPlaybackStateSnapshot extends DramaIdentity {
@@ -7743,6 +8524,14 @@ declare class VePlayer {
7743
8524
  * @memberof VePlayer
7744
8525
  */
7745
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?;
7746
8535
  /** 最近一次用户选择的音轨,用于清晰度切换后通过 setAudioOption 恢复音轨 */
7747
8536
  private _lastSelectedAudioTrack;
7748
8537
  /**
@@ -8301,6 +9090,14 @@ declare class VePlayer {
8301
9090
  * @memberof VePlayer
8302
9091
  */
8303
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;
8304
9101
  _setVeError(): void;
8305
9102
  /**
8306
9103
  * @hidden
@@ -8615,12 +9412,177 @@ declare class VePlayer {
8615
9412
  /** {en}
8616
9413
  * @brief Get the definition list. Each item has `definition`, `url`, and `selected` (true for the active level).
8617
9414
  */
8618
- getDefinitionList(): Array<{
8619
- definition: string;
8620
- url: IUrl;
8621
- selected: boolean;
8622
- [propName: string]: any;
8623
- }>;
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;
8624
9586
  /** {zh}
8625
9587
  * @brief 获取音频轨道列表。HLS 流通过 hls.js 获取,iOS 原生播放通过 HTMLMediaElement.audioTracks 获取。
8626
9588
  * @notes 每项包含 `id`、`name`、`lang`、`channels`、`default`、`selected` 字段;轨道数量 ≤ 1 时返回空数组。
@@ -8896,16 +9858,51 @@ declare class VePlayer {
8896
9858
  */
8897
9859
  getPlugin(pluginName: string): null | BasePlugin;
8898
9860
  /** {zh}
8899
- * @brief 获取字幕列表。需配置 `Subtitle` 插件后调用。
8900
- * @return 当前字幕列表,每项包含 `id`、`language`、`text`(显示名称)等字段。列表为空时返回空数组。
8901
- * @memberof VePlayer
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
+ * ```
8902
9881
  */
8903
9882
  getSubtitleList(): ISubTitleItem[];
8904
9883
  /** {zh}
8905
- * @brief 切换字幕。需配置 `Subtitle` 插件后调用。
8906
- * @param subtitle 目标字幕的 id 或 language,任意一个非空即可定位字幕项。
8907
- * @return 切换成功时 resolve,失败(未找到、切换被中止)时 reject。
8908
- * @memberof VePlayer
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
+ * ```
8909
9906
  */
8910
9907
  switchSubtitle(subtitle: {
8911
9908
  id?: string | number;
@@ -8913,12 +9910,36 @@ declare class VePlayer {
8913
9910
  }): Promise<void>;
8914
9911
  /** {zh}
8915
9912
  * @brief 开启字幕展示。恢复上次选中的字幕项;若从未选中过则默认选第一项。需配置 `Subtitle` 插件后调用。
8916
- * @memberof VePlayer
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
+ * ```
8917
9926
  */
8918
9927
  showSubtitle(): void;
8919
9928
  /** {zh}
8920
9929
  * @brief 关闭字幕展示。字幕数据保留,可通过 `showSubtitle` 重新开启。需配置 `Subtitle` 插件后调用。
8921
- * @memberof VePlayer
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
+ * ```
8922
9943
  */
8923
9944
  hideSubtitle(): void;
8924
9945
  /** {zh}
@@ -9086,12 +10107,21 @@ export declare class LiveSubtitlesIconPlugin extends Plugin {
9086
10107
  destroy(): void;
9087
10108
  render(): string;
9088
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
+ };
9089
10118
  declare class NativeSubTitle extends EventEmitter {
9090
10119
  _media: any;
9091
10120
  _list: any[];
9092
10121
  _languages: string;
9093
10122
  curIndex: number;
9094
- constructor(media: any);
10123
+ private _domAdapter?;
10124
+ constructor(media: any, options?: NativeSubTitleOptions);
9095
10125
  _init(): void;
9096
10126
  _onChange: (e: any) => void;
9097
10127
  /**
@@ -9105,6 +10135,8 @@ declare class NativeSubTitle extends EventEmitter {
9105
10135
  switch(data: any): Promise<unknown>;
9106
10136
  switchOff(): void;
9107
10137
  destroy(): void;
10138
+ refresh(): void;
10139
+ setPlaybackSessionId(playbackSessionId: string): void;
9108
10140
  }
9109
10141
  export interface IPanelItem {
9110
10142
  showText: string;
@@ -9136,6 +10168,7 @@ export declare class Subtitle extends Plugin {
9136
10168
  };
9137
10169
  isShowIcon: boolean;
9138
10170
  mode: string;
10171
+ nativeRenderMode: string;
9139
10172
  updateMode: string;
9140
10173
  };
9141
10174
  private _delegates;
@@ -9148,6 +10181,11 @@ export declare class Subtitle extends Plugin {
9148
10181
  player: Player & {
9149
10182
  _subTitles?: NativeSubTitle | SubTitles;
9150
10183
  };
10184
+ private _hideListTimer;
10185
+ private _optionListEnterHandler?;
10186
+ private _optionListLeaveHandler?;
10187
+ private _runtimeSubtitleSource;
10188
+ private _runtimeSubtitleBridge?;
9151
10189
  afterCreate(): void;
9152
10190
  /**
9153
10191
  * @description 初始化原生字幕
@@ -9159,6 +10197,7 @@ export declare class Subtitle extends Plugin {
9159
10197
  * @param {number} defaultIndex
9160
10198
  */
9161
10199
  _initExtSubTitle(defaultIndex: any): void;
10200
+ private protectExtSubtitleCoreEvents;
9162
10201
  _renderList(defaultIndex: any): void;
9163
10202
  _onOff: () => void;
9164
10203
  _onChange: (data: any) => void;
@@ -9166,15 +10205,30 @@ export declare class Subtitle extends Plugin {
9166
10205
  updateCurItem(cIndex: any, subtitle: any): void;
9167
10206
  initEvents(): void;
9168
10207
  handleButtonChange: (e: any) => void;
10208
+ private runUiSubtitleAction;
9169
10209
  onEnter: (e: any) => void;
9170
10210
  onLeave: (e: any) => void;
10211
+ private clearPendingListHide;
10212
+ private scheduleListHide;
10213
+ private bindOptionListHoverEvents;
10214
+ private unbindOptionListHoverEvents;
9171
10215
  showList(): void;
9172
10216
  hideList(): void;
9173
10217
  openSubtitle(): Promise<any>;
9174
- getSubTitleIndex(list: any, subtitle?: {
9175
- id: string;
9176
- language: string;
9177
- }): number;
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;
9178
10232
  registerIcons(): {
9179
10233
  vttSubOpen: {
9180
10234
  icon: string;
@@ -9205,6 +10259,7 @@ export declare class Subtitle extends Plugin {
9205
10259
  "zh-hk": string;
9206
10260
  };
9207
10261
  };
10262
+ updateLang(lang: string): void;
9208
10263
  creatOptionList(): void;
9209
10264
  getList(): any;
9210
10265
  renderOptionList(): void;
@@ -9673,285 +10728,55 @@ export declare const Events: {
9673
10728
  * @brief Triggered when mirror mode is enabled.
9674
10729
  */
9675
10730
  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;
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";
9955
10780
  /** {zh}
9956
10781
  * @brief 在播放被终止时触发。例如当播放中的视频重新开始播放。
9957
10782
  */
@@ -10124,126 +10949,126 @@ export declare const Event: {
10124
10949
  /** {en}
10125
10950
  * @brief Triggered when the player instance is created.
10126
10951
  */
10127
- READY: string;
10952
+ readonly READY: "ready";
10128
10953
  /** {zh}
10129
10954
  * @brief 播放器创建 `video` 完成时触发,表示可以开始播放。
10130
10955
  */
10131
10956
  /** {en}
10132
10957
  * @brief Triggered when the player has created the `video` element and playback can start.
10133
10958
  */
10134
- COMPLETE: string;
10959
+ readonly COMPLETE: "complete";
10135
10960
  /** {zh}
10136
10961
  * @brief 播放资源发生变化。
10137
10962
  */
10138
10963
  /** {en}
10139
10964
  * @brief Triggered when the playback resource changes.
10140
10965
  */
10141
- URL_CHANGE: string;
10966
+ readonly URL_CHANGE: "urlchange";
10142
10967
  /** {zh}
10143
10968
  * @brief 播放器聚焦,同时会展示 Control 栏控件,包含播放按钮、进度条等。
10144
10969
  */
10145
10970
  /** {en}
10146
10971
  * @brief Triggered when the player gains focus; the control bar is shown.
10147
10972
  */
10148
- PLAYER_FOCUS: string;
10973
+ readonly PLAYER_FOCUS: "focus";
10149
10974
  /** {zh}
10150
10975
  * @brief 播放器失焦,同时会隐藏 Control 栏控件,包含播放按钮、进度条等。
10151
10976
  */
10152
10977
  /** {en}
10153
10978
  * @brief Triggered when the player loses focus; the control bar is hidden.
10154
10979
  */
10155
- PLAYER_BLUR: string;
10980
+ readonly PLAYER_BLUR: "blur";
10156
10981
  /** {zh}
10157
10982
  * @brief 系统全屏状态切换。
10158
10983
  */
10159
10984
  /** {en}
10160
10985
  * @brief Triggered when native fullscreen state changes.
10161
10986
  */
10162
- FULLSCREEN_CHANGE: string;
10987
+ readonly FULLSCREEN_CHANGE: "fullscreen_change";
10163
10988
  /** {zh}
10164
10989
  * @brief 网页全屏状态切换。
10165
10990
  */
10166
10991
  /** {en}
10167
10992
  * @brief Triggered when CSS fullscreen state changes.
10168
10993
  */
10169
- CSS_FULLSCREEN_CHANGE: string;
10994
+ readonly CSS_FULLSCREEN_CHANGE: "cssFullscreen_change";
10170
10995
  /** {zh}
10171
10996
  * @brief 画中画模式切换。
10172
10997
  */
10173
10998
  /** {en}
10174
10999
  * @brief Triggered when mini player (floating) mode changes.
10175
11000
  */
10176
- MINI_STATE_CHANGE: string;
11001
+ readonly MINI_STATE_CHANGE: "mini_state_change";
10177
11002
  /** {zh}
10178
11003
  * @brief 播放器销毁。
10179
11004
  */
10180
11005
  /** {en}
10181
11006
  * @brief Triggered when the player is destroyed.
10182
11007
  */
10183
- DESTROY: string;
11008
+ readonly DESTROY: "destroy";
10184
11009
  /** {zh}
10185
11010
  * @brief 播放器重新播放。
10186
11011
  */
10187
11012
  /** {en}
10188
11013
  * @brief Triggered when replay starts.
10189
11014
  */
10190
- REPLAY: string;
11015
+ readonly REPLAY: "replay";
10191
11016
  /** {zh}
10192
11017
  * @brief 播放器重试。
10193
11018
  */
10194
11019
  /** {en}
10195
11020
  * @brief Triggered when the player retries playback.
10196
11021
  */
10197
- RETRY: string;
11022
+ readonly RETRY: "retry";
10198
11023
  /** {zh}
10199
11024
  * @brief 清晰度发生变化
10200
11025
  */
10201
11026
  /** {en}
10202
11027
  * @brief Triggered when the definition (resolution) changes.
10203
11028
  */
10204
- DEFINITION_CHANGE: string;
11029
+ readonly DEFINITION_CHANGE: "definition_change";
10205
11030
  /** {zh}
10206
11031
  * @hidden
10207
11032
  */
10208
11033
  /** {en}
10209
11034
  * @hidden
10210
11035
  */
10211
- Before_DEFINITION_CHANGE: string;
11036
+ readonly Before_DEFINITION_CHANGE: "before_definition_change";
10212
11037
  /** {zh}
10213
11038
  * @hidden
10214
11039
  */
10215
11040
  /** {en}
10216
11041
  * @hidden
10217
11042
  */
10218
- AFTER_DEFINITION_CHANGE: string;
11043
+ readonly AFTER_DEFINITION_CHANGE: "after_definition_change";
10219
11044
  /** {zh}
10220
11045
  * @brief 播放器容器尺寸发生变化。
10221
11046
  */
10222
11047
  /** {en}
10223
11048
  * @brief Triggered when the player container size changes.
10224
11049
  */
10225
- VIDEO_RESIZE: string;
11050
+ readonly VIDEO_RESIZE: "video_resize";
10226
11051
  /** {zh}
10227
11052
  * @brief 画中画状态切换。
10228
11053
  */
10229
11054
  /** {en}
10230
11055
  * @brief Triggered when Picture-in-Picture state changes.
10231
11056
  */
10232
- PIP_CHANGE: string;
11057
+ readonly PIP_CHANGE: "pip_change";
10233
11058
  /** {zh}
10234
11059
  * @brief 播放器发生旋转。
10235
11060
  */
10236
11061
  /** {en}
10237
11062
  * @brief Triggered when the player is rotated.
10238
11063
  */
10239
- ROTATE: string;
11064
+ readonly ROTATE: "rotate";
10240
11065
  /** {zh}
10241
11066
  * @brief 播放器内置快捷键事件被触发。
10242
11067
  */
10243
11068
  /** {en}
10244
11069
  * @brief Triggered when a built-in keyboard shortcut is used.
10245
11070
  */
10246
- SHORTCUT: string;
11071
+ readonly SHORTCUT: "shortcut";
10247
11072
  /** {zh}
10248
11073
  * @deprecated
10249
11074
  * @brief (已废弃)SEI 信息解析。
@@ -10252,151 +11077,214 @@ export declare const Event: {
10252
11077
  * @deprecated
10253
11078
  * @brief (Deprecated) SEI information parsing.
10254
11079
  */
10255
- SEI_PARSED: string;
11080
+ readonly SEI_PARSED: "SEI_PARSED";
10256
11081
  /** {zh}
10257
11082
  * @brief 内置插件用户行为触发。所有内置插件用户行为交互都会下发该事件,可用于用户行为埋点。
10258
11083
  */
10259
11084
  /** {en}
10260
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.
10261
11086
  */
10262
- USER_ACTION: string;
11087
+ readonly USER_ACTION: "user_action";
10263
11088
  /** {zh}
10264
11089
  * @brief 自动播放成功时触发。
10265
11090
  */
10266
11091
  /** {en}
10267
11092
  * @brief Triggered when autoplay succeeds.
10268
11093
  */
10269
- AUTOPLAY_STARTED: string;
11094
+ readonly AUTOPLAY_STARTED: "autoplay_started";
10270
11095
  /** {zh}
10271
11096
  * @brief 自动播放失败时触发。
10272
11097
  */
10273
11098
  /** {en}
10274
11099
  * @brief Triggered when autoplay fails.
10275
11100
  */
10276
- AUTOPLAY_PREVENTED: string;
11101
+ readonly AUTOPLAY_PREVENTED: "autoplay_was_prevented";
10277
11102
  /** {zh}
10278
11103
  * @brief 播放器准备创建。
10279
11104
  */
10280
- READY_CREATE_PLAYER: string;
11105
+ readonly READY_CREATE_PLAYER: "ready_create_player";
10281
11106
  /** {zh}
10282
11107
  * @brief 播放器完成创建。
10283
11108
  */
10284
11109
  /** {en}
10285
11110
  * @brief Triggered when player creation completes.
10286
11111
  */
10287
- PLAYER_CREATED_FINISH: string;
11112
+ readonly PLAYER_CREATED_FINISH: "player_create_finish";
10288
11113
  /** {zh}
10289
11114
  * @brief createPlayer 性能报告。与 `PLAYER_CREATED_FINISH` 几乎同时触发(略早)。
10290
11115
  */
10291
11116
  /** {en}
10292
11117
  * @brief createPlayer performance report. Fired almost at the same time as `PLAYER_CREATED_FINISH` (slightly earlier).
10293
11118
  */
10294
- CREATE_PLAYER_PERF: string;
11119
+ readonly CREATE_PLAYER_PERF: "create_player_perf";
10295
11120
  /** {zh}
10296
11121
  * @brief 播放器重建。
10297
11122
  */
10298
11123
  /** {en}
10299
11124
  * @brief Triggered when the player is rebuilt.
10300
11125
  */
10301
- PLAYER_REBUILD: string;
11126
+ readonly PLAYER_REBUILD: "player_rebuild";
10302
11127
  /** {zh}
10303
11128
  * @brief 硬解不支持时触发。
10304
11129
  */
10305
11130
  /** {en}
10306
11131
  * @brief Triggered when hardware decoding is not supported.
10307
11132
  */
10308
- NOT_SUPPORT_HARDWARE_DECODER: string;
11133
+ readonly NOT_SUPPORT_HARDWARE_DECODER: "not_support_hardware_decoder";
10309
11134
  /** {zh}
10310
11135
  * @brief 软解不支持时触发。
10311
11136
  */
10312
11137
  /** {en}
10313
11138
  * @brief Triggered when software decoding is not supported.
10314
11139
  */
10315
- NOT_SUPPORT_SOFT_DECODER: string;
11140
+ readonly NOT_SUPPORT_SOFT_DECODER: "not_support_soft_decoder";
10316
11141
  /** {zh}
10317
11142
  * @brief `playAuthToken` 过期。
10318
11143
  */
10319
11144
  /** {en}
10320
11145
  * @brief Triggered when `playAuthToken` expires.
10321
11146
  */
10322
- TOKEN_EXPIRED: string;
11147
+ readonly TOKEN_EXPIRED: "playAuthToken_expired";
10323
11148
  /** {zh}
10324
11149
  * @brief UMD 加载失败。
10325
11150
  */
10326
11151
  /** {en}
10327
11152
  * @brief Triggered when UMD loading fails.
10328
11153
  */
10329
- UMD_LOAD_FAIL: string;
11154
+ readonly UMD_LOAD_FAIL: "umd_load_fail";
10330
11155
  /** {zh}
10331
11156
  * @brief 切换下一个视频。调用 `playNext` 后触发。
10332
11157
  */
10333
11158
  /** {en}
10334
11159
  * @brief Triggered when switching to the next video, after calling `playNext`.
10335
11160
  */
10336
- PLAYNEXT: string;
11161
+ readonly PLAYNEXT: "playnext";
10337
11162
  /** {zh}
10338
11163
  * @brief 视频地址为空。
10339
11164
  */
10340
11165
  /** {en}
10341
11166
  * @brief Triggered when the video URL is empty.
10342
11167
  */
10343
- URL_NULL: string;
11168
+ readonly URL_NULL: "urlNull";
10344
11169
  /** {zh}
10345
11170
  * @brief 鼠标移出。
10346
11171
  */
10347
11172
  /** {en}
10348
11173
  * @brief Triggered when the mouse leaves the player.
10349
11174
  */
10350
- LEAVE_PLAYER: string;
11175
+ readonly LEAVE_PLAYER: "leaveplayer";
10351
11176
  /** {zh}
10352
11177
  * @brief 鼠标移入。
10353
11178
  */
10354
11179
  /** {en}
10355
11180
  * @brief Triggered when the mouse enters the player.
10356
11181
  */
10357
- ENTER_PLAYER: string;
11182
+ readonly ENTER_PLAYER: "enterplayer";
10358
11183
  /** {zh}
10359
11184
  * @brief 播放器状态重置。
10360
11185
  */
10361
11186
  /** {en}
10362
11187
  * @brief Triggered when the player state is reset.
10363
11188
  */
10364
- RESET: string;
11189
+ readonly RESET: "reset";
10365
11190
  /** {zh}
10366
11191
  * @brief `<source>` 加载错误,表示 `<source>` 不支持或播放失败。
10367
11192
  */
10368
11193
  /** {en}
10369
11194
  * @brief Triggered when a `<source>` fails to load (unsupported or playback failed).
10370
11195
  */
10371
- SOURCE_ERROR: string;
11196
+ readonly SOURCE_ERROR: "source_error";
10372
11197
  /** {zh}
10373
11198
  * @brief `<source>` 加载成功。
10374
11199
  */
10375
11200
  /** {en}
10376
11201
  * @brief Triggered when a `<source>` loads successfully.
10377
11202
  */
10378
- SOURCE_SUCCESS: string;
11203
+ readonly SOURCE_SUCCESS: "source_success";
10379
11204
  /** {zh}
10380
11205
  * @brief license 提醒
10381
11206
  */
10382
11207
  /** {en}
10383
11208
  * @brief License status warning.
10384
11209
  */
10385
- LICENSE_STATUS_WARNING: string;
11210
+ readonly LICENSE_STATUS_WARNING: "license_status_warning";
10386
11211
  /** {zh}
10387
11212
  * @brief HLS 音频轨道列表更新时触发。`data.audioTracks` 为完整轨道数组。
10388
11213
  */
10389
11214
  /** {en}
10390
11215
  * @brief Triggered when the HLS audio track list updates. `data.audioTracks` is the full track array.
10391
11216
  */
10392
- AUDIO_TRACKS_UPDATED: string;
11217
+ readonly AUDIO_TRACKS_UPDATED: "audio_tracks_updated";
10393
11218
  /** {zh}
10394
11219
  * @brief 音频轨道切换完成时触发。`data.id` 为新轨道 id,`data.audioTrack` 为完整轨道对象。
10395
11220
  */
10396
11221
  /** {en}
10397
11222
  * @brief Triggered when audio track switching completes. `data.id` is the new track id; `data.audioTrack` is the full track object.
10398
11223
  */
10399
- AUDIO_TRACK_CHANGE: string;
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";
10400
11288
  };
10401
11289
  PluginEvents: {
10402
11290
  /** {zh}