@byteplus/veplayer 1.19.0-rc.3 → 1.19.0-rc.5

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,45 +546,6 @@ 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;
588
549
  /** {zh}
589
550
  * @brief 是否默认打开字幕。
590
551
  * @default true
@@ -616,19 +577,6 @@ export interface ISubtitleConfig {
616
577
  * @default external
617
578
  */
618
579
  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";
632
580
  /**
633
581
  * @brief 字幕更新模式,默认vod
634
582
  * @default vod
@@ -821,15 +769,6 @@ export interface ISubtitleStyle {
821
769
  * @kind property
822
770
  */
823
771
  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";
833
772
  /** {zh}
834
773
  * @brief 字幕语言。
835
774
  * @default -
@@ -857,24 +796,6 @@ export interface ISubTitleItem {
857
796
  * @default false
858
797
  */
859
798
  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;
878
799
  /** {zh}
879
800
  * @brief 字幕名称。
880
801
  * @default -
@@ -883,7 +804,7 @@ export interface ISubTitleItem {
883
804
  * @brief Subtitle display name.
884
805
  * @default -
885
806
  */
886
- text?: ISubtitleLabelValue;
807
+ text?: string;
887
808
  /** {zh}
888
809
  * @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
889
810
  * @default -
@@ -892,7 +813,7 @@ export interface ISubTitleItem {
892
813
  * @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
893
814
  * @default -
894
815
  */
895
- label?: ISubtitleLabelValue;
816
+ label?: string | number;
896
817
  /** {zh}
897
818
  * @brief 外挂字幕 URL 地址。
898
819
  * @default -
@@ -922,118 +843,6 @@ export interface ISubTitleItem {
922
843
  */
923
844
  list?: IListItem[];
924
845
  }
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
- }
1037
846
  export declare type IAutoSubtitleSourceItem = Record<string, any> | string;
1038
847
  export declare type IAutoSubtitleFormatterResult = string | number | boolean | null | undefined | {
1039
848
  label?: string | number;
@@ -3385,6 +3194,19 @@ export interface ITTDramaEnv {
3385
3194
  * @type {function}
3386
3195
  */
3387
3196
  sendLog: (EventName: string, params: Record<string, any>) => void;
3197
+ /** {zh}
3198
+ * @hidden
3199
+ * @brief 当前在播短剧身份变化通知,由宿主集成层消费。
3200
+ */
3201
+ /** {en}
3202
+ * @hidden
3203
+ * @brief Notifies the host integration when the current drama playback identity changes.
3204
+ */
3205
+ onCurrentDramaPlaybackContextChange?: (context: {
3206
+ albumId: string | null;
3207
+ episodeId: string | null;
3208
+ vid: string | null;
3209
+ } | null) => boolean | void;
3388
3210
  /**
3389
3211
  * 低版本 app 下验证 TTOP 签发的 playAuthToken 时使用的密钥
3390
3212
  * 通过 JSB(如 minis.getSecret)从 Native 获取,用于 HMAC-SHA256 签名校验
@@ -3606,465 +3428,6 @@ export interface IVideoInfo {
3606
3428
  Data: IGetPlayInfoRes;
3607
3429
  };
3608
3430
  }
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
- }
4068
3431
  export declare type TAPIRegionConfig = {
4069
3432
  __PLAY_DOMAIN__: string;
4070
3433
  __BACKUP_PLAY_DOMAIN__?: string;
@@ -5336,7 +4699,6 @@ export interface IPlayerConfig extends IPlayerOptions {
5336
4699
  * - **Android**:直接启用 hls.js 播放。
5337
4700
  * - **iOS**:仅在设备支持 `ManagedMediaSource`(iOS 17.1+,即 `VePlayer.isMMSSupported()` 为 `true`)时启用;
5338
4701
  * 不满足时自动回退至原生 HLS 播放。
5339
- * - **`isMobile` 模拟模式**:当前浏览器支持 MSE 或 MMS 时启用 hls.js。
5340
4702
  * 开启后可在移动端解锁多音轨切换、`setAudioOption` 偏好持久化等 hls.js 特有能力。
5341
4703
  * @default false
5342
4704
  */
@@ -5345,79 +4707,10 @@ export interface IPlayerConfig extends IPlayerOptions {
5345
4707
  * - **Android**: always enables hls.js.
5346
4708
  * - **iOS**: enables hls.js only when `ManagedMediaSource` is supported (iOS 17.1+,
5347
4709
  * 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.
5349
4710
  * Unlocks hls.js-specific features such as multi-audio-track switching on mobile.
5350
4711
  * @default false
5351
4712
  */
5352
4713
  enableMobileHlsPlugin?: boolean;
5353
- /** {zh}
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
4714
  /** {zh}
5422
4715
  * @brief 是否启用 {@link https://hlsjs.video-dev.org/ hls.js} 插件播放HLS视频,默认为true,设置为false后,PC端播放HLS使用自研hls插件播放HLS视频
5423
4716
  * @default true
@@ -7295,238 +6588,6 @@ declare abstract class AbstractBaseAdapter {
7295
6588
  abstract getPlugins(umdLoader: UMDLoader): Promise<XGPlugin[]>;
7296
6589
  abstract setPluginConfigInVid(videoInfo: IVideoInfo, context: AuthToken): void;
7297
6590
  }
7298
- /** {zh}
7299
- * @list Options
7300
- * @brief 字幕项。
7301
- * @kind property
7302
- */
7303
- /** {en}
7304
- * @list Options
7305
- * @brief Subtitle item.
7306
- * @kind property
7307
- */
7308
- export interface ISubTitleItem {
7309
- /** {zh}
7310
- * @brief 字幕来源。业务配置字幕为 `config`,Master M3U8 或原生 HLS 字幕为 `hls`。
7311
- * @default config
7312
- */
7313
- /** {en}
7314
- * @brief Subtitle source. Business-configured subtitles use `config`; Master M3U8 or native HLS subtitles use `hls`.
7315
- * @default config
7316
- */
7317
- source?: "config" | "hls";
7318
- /** {zh}
7319
- * @brief 字幕语言。
7320
- * @default -
7321
- */
7322
- /** {en}
7323
- * @brief Subtitle language.
7324
- * @default -
7325
- */
7326
- language?: string | number;
7327
- /** {zh}
7328
- * @brief 字幕 ID。
7329
- * @default -
7330
- */
7331
- /** {en}
7332
- * @brief Subtitle ID.
7333
- * @default -
7334
- */
7335
- id?: number | string;
7336
- /** {zh}
7337
- * @brief 是否为默认选择的字幕。
7338
- * @default false
7339
- */
7340
- /** {en}
7341
- * @brief Whether this is the default selected subtitle.
7342
- * @default false
7343
- */
7344
- isDefault?: boolean;
7345
- /** {zh}
7346
- * @brief 是否为强制字幕轨。
7347
- * @default false
7348
- */
7349
- /** {en}
7350
- * @brief Whether the subtitle track is forced.
7351
- * @default false
7352
- */
7353
- forced?: boolean;
7354
- /** {zh}
7355
- * @brief HLS 字幕轨的特征标识,例如无障碍字幕特征;未声明时为空。
7356
- * @default -
7357
- */
7358
- /** {en}
7359
- * @brief HLS subtitle-track characteristics, such as accessibility traits; absent when not declared.
7360
- * @default -
7361
- */
7362
- characteristics?: string;
7363
- /** {zh}
7364
- * @brief 字幕名称。
7365
- * @default -
7366
- */
7367
- /** {en}
7368
- * @brief Subtitle display name.
7369
- * @default -
7370
- */
7371
- text?: ISubtitleLabelValue;
7372
- /** {zh}
7373
- * @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
7374
- * @default -
7375
- */
7376
- /** {en}
7377
- * @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
7378
- * @default -
7379
- */
7380
- label?: ISubtitleLabelValue;
7381
- /** {zh}
7382
- * @brief 外挂字幕 URL 地址。
7383
- * @default -
7384
- */
7385
- /** {en}
7386
- * @brief External subtitle URL.
7387
- * @default -
7388
- */
7389
- url?: string;
7390
- /**
7391
- * @hidden
7392
- * @type {string}
7393
- * @memberof ISubTitleItem
7394
- */
7395
- stringContent?: string;
7396
- /** {zh}
7397
- * @brief 字幕内容列表。非 `url` 形式时使用。
7398
- * @default -
7399
- * @type {Array<Object>}
7400
- * @memberof ISubTitleItem
7401
- */
7402
- /** {en}
7403
- * @brief Subtitle content list when not using URL.
7404
- * @default -
7405
- * @type {Array<Object>}
7406
- * @memberof ISubTitleItem
7407
- */
7408
- list?: IListItem[];
7409
- }
7410
- /** {zh}
7411
- * @brief 字幕项名称,可为静态文案或按播放器语言配置的文案表。
7412
- * @detail ref
7413
- */
7414
- /** {en}
7415
- * @brief Subtitle item name as static text or a text map keyed by player language.
7416
- * @detail ref
7417
- */
7418
- export type ISubtitleLabelValue = string | number | Record<string, string | number>;
7419
- /** {zh}
7420
- * @brief 字幕内容项。
7421
- * @list Options
7422
- * @kind property
7423
- * @export
7424
- * @interface IListItem
7425
- */
7426
- /** {en}
7427
- * @brief Subtitle content item.
7428
- * @list Options
7429
- * @kind property
7430
- * @export
7431
- * @interface IListItem
7432
- */
7433
- export interface IListItem {
7434
- /** {zh}
7435
- * @brief 开始时间,单位为秒。
7436
- * @type {number}
7437
- */
7438
- /** {en}
7439
- * @brief Start time in seconds.
7440
- * @type {number}
7441
- */
7442
- start: number;
7443
- /** {zh}
7444
- * @brief 结束时间,单位为秒。
7445
- * @type {number}
7446
- */
7447
- /** {en}
7448
- * @brief End time in seconds.
7449
- * @type {number}
7450
- */
7451
- end: number;
7452
- /** {zh}
7453
- * @brief 字幕数据列表。
7454
- * @type {Array<ITextItem>}
7455
- */
7456
- /** {en}
7457
- * @brief Subtitle cue data list.
7458
- * @type {Array<ITextItem>}
7459
- */
7460
- list: Array<ITextItem>;
7461
- /**
7462
- * @hidden
7463
- * @type {any}
7464
- */
7465
- [propName: string]: any;
7466
- }
7467
- /** {zh}
7468
- * @brief 字幕文案配置。
7469
- * @list Options
7470
- * @kind property
7471
- */
7472
- /** {en}
7473
- * @brief Subtitle text item configuration.
7474
- * @list Options
7475
- * @kind property
7476
- */
7477
- export interface ITextItem {
7478
- /**
7479
- * @hidden
7480
- * @type {any}
7481
- */
7482
- [propName: string]: any;
7483
- /** {zh}
7484
- * @brief 开始时间,单位为秒。
7485
- * @type {number}
7486
- */
7487
- /** {en}
7488
- * @brief Start time in seconds.
7489
- * @type {number}
7490
- */
7491
- start: number;
7492
- /** {zh}
7493
- * @brief 结束时间,单位为秒。
7494
- * @type {number}
7495
- */
7496
- /** {en}
7497
- * @brief End time in seconds.
7498
- * @type {number}
7499
- */
7500
- end: number;
7501
- /** {zh}
7502
- * @brief 字幕文案数组。
7503
- * @type {string[]}
7504
- */
7505
- /** {en}
7506
- * @brief Subtitle text array.
7507
- * @type {string[]}
7508
- */
7509
- text: string[];
7510
- /** {zh}
7511
- * @brief 字幕顺序。
7512
- * @type {number}
7513
- */
7514
- /** {en}
7515
- * @brief Subtitle display order.
7516
- * @type {number}
7517
- */
7518
- index?: number;
7519
- }
7520
- /** {zh}
7521
- * @brief HLS 自动码率决策引擎配置值。
7522
- * @detail ref
7523
- */
7524
- /** {en}
7525
- * @brief Configurable HLS adaptive-bitrate decision engine.
7526
- * @detail ref
7527
- */
7528
- export type HlsAbrEngine = "hlsjs" | "veplayer";
7529
- export type TLogChannel = "cn" | "va" | "sg";
7530
6591
  declare class PlayerData {
7531
6592
  id?: string;
7532
6593
  root?: HTMLElement;
@@ -7628,8 +6689,6 @@ declare class PlayerData {
7628
6689
  */
7629
6690
  getCurrentStreamType(): string;
7630
6691
  getStreamType(): string;
7631
- getConfiguredHlsAbrEngine(): HlsAbrEngine;
7632
- isOpenVePlayerABR(): boolean;
7633
6692
  isOpenABR(): boolean;
7634
6693
  showRealDefinition(): boolean;
7635
6694
  isAutoDefinition(def: any): boolean;
@@ -7998,11 +7057,198 @@ export declare type IMediaInfoPrefetchFailure = {
7998
7057
  * @detail ref
7999
7058
  */
8000
7059
  /** {en}
8001
- * @brief Result for one media info prefetch item. Batch results preserve input order, and one failure does not interrupt other items.
8002
- * @detail ref
7060
+ * @brief Result for one media info prefetch item. Batch results preserve input order, and one failure does not interrupt other items.
7061
+ * @detail ref
7062
+ */
7063
+ export declare type IMediaInfoPrefetchResult = IMediaInfoPrefetchSuccess | IMediaInfoPrefetchFailure;
7064
+ export declare type IPreloadStream = IPreloadResolvedStream | IPreloadDramaStream | IPreloadAuthTokenStream;
7065
+ /** {zh}
7066
+ * @list Options
7067
+ * @brief 字幕项。
7068
+ * @kind property
7069
+ */
7070
+ /** {en}
7071
+ * @list Options
7072
+ * @brief Subtitle item.
7073
+ * @kind property
7074
+ */
7075
+ export interface ISubTitleItem {
7076
+ /** {zh}
7077
+ * @brief 字幕语言。
7078
+ * @default -
7079
+ */
7080
+ /** {en}
7081
+ * @brief Subtitle language.
7082
+ * @default -
7083
+ */
7084
+ language?: string | number;
7085
+ /** {zh}
7086
+ * @brief 字幕 ID。
7087
+ * @default -
7088
+ */
7089
+ /** {en}
7090
+ * @brief Subtitle ID.
7091
+ * @default -
7092
+ */
7093
+ id?: number | string;
7094
+ /** {zh}
7095
+ * @brief 是否为默认选择的字幕。
7096
+ * @default false
7097
+ */
7098
+ /** {en}
7099
+ * @brief Whether this is the default selected subtitle.
7100
+ * @default false
7101
+ */
7102
+ isDefault?: boolean;
7103
+ /** {zh}
7104
+ * @brief 字幕名称。
7105
+ * @default -
7106
+ */
7107
+ /** {en}
7108
+ * @brief Subtitle display name.
7109
+ * @default -
7110
+ */
7111
+ text?: string;
7112
+ /** {zh}
7113
+ * @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
7114
+ * @default -
7115
+ */
7116
+ /** {en}
7117
+ * @brief 字幕名称。兼容 xgplayer-subtitles 的 label 字段。
7118
+ * @default -
7119
+ */
7120
+ label?: string | number;
7121
+ /** {zh}
7122
+ * @brief 外挂字幕 URL 地址。
7123
+ * @default -
7124
+ */
7125
+ /** {en}
7126
+ * @brief External subtitle URL.
7127
+ * @default -
7128
+ */
7129
+ url?: string;
7130
+ /**
7131
+ * @hidden
7132
+ * @type {string}
7133
+ * @memberof ISubTitleItem
7134
+ */
7135
+ stringContent?: string;
7136
+ /** {zh}
7137
+ * @brief 字幕内容列表。非 `url` 形式时使用。
7138
+ * @default -
7139
+ * @type {Array<Object>}
7140
+ * @memberof ISubTitleItem
7141
+ */
7142
+ /** {en}
7143
+ * @brief Subtitle content list when not using URL.
7144
+ * @default -
7145
+ * @type {Array<Object>}
7146
+ * @memberof ISubTitleItem
7147
+ */
7148
+ list?: IListItem[];
7149
+ }
7150
+ /** {zh}
7151
+ * @brief 字幕内容项。
7152
+ * @list Options
7153
+ * @kind property
7154
+ * @export
7155
+ * @interface IListItem
7156
+ */
7157
+ /** {en}
7158
+ * @brief Subtitle content item.
7159
+ * @list Options
7160
+ * @kind property
7161
+ * @export
7162
+ * @interface IListItem
7163
+ */
7164
+ export interface IListItem {
7165
+ /** {zh}
7166
+ * @brief 开始时间,单位为秒。
7167
+ * @type {number}
7168
+ */
7169
+ /** {en}
7170
+ * @brief Start time in seconds.
7171
+ * @type {number}
7172
+ */
7173
+ start: number;
7174
+ /** {zh}
7175
+ * @brief 结束时间,单位为秒。
7176
+ * @type {number}
7177
+ */
7178
+ /** {en}
7179
+ * @brief End time in seconds.
7180
+ * @type {number}
7181
+ */
7182
+ end: number;
7183
+ /** {zh}
7184
+ * @brief 字幕数据列表。
7185
+ * @type {Array<ITextItem>}
7186
+ */
7187
+ /** {en}
7188
+ * @brief Subtitle cue data list.
7189
+ * @type {Array<ITextItem>}
7190
+ */
7191
+ list: Array<ITextItem>;
7192
+ /**
7193
+ * @hidden
7194
+ * @type {any}
7195
+ */
7196
+ [propName: string]: any;
7197
+ }
7198
+ /** {zh}
7199
+ * @brief 字幕文案配置。
7200
+ * @list Options
7201
+ * @kind property
7202
+ */
7203
+ /** {en}
7204
+ * @brief Subtitle text item configuration.
7205
+ * @list Options
7206
+ * @kind property
8003
7207
  */
8004
- export declare type IMediaInfoPrefetchResult = IMediaInfoPrefetchSuccess | IMediaInfoPrefetchFailure;
8005
- export declare type IPreloadStream = IPreloadResolvedStream | IPreloadDramaStream | IPreloadAuthTokenStream;
7208
+ export interface ITextItem {
7209
+ /**
7210
+ * @hidden
7211
+ * @type {any}
7212
+ */
7213
+ [propName: string]: any;
7214
+ /** {zh}
7215
+ * @brief 开始时间,单位为秒。
7216
+ * @type {number}
7217
+ */
7218
+ /** {en}
7219
+ * @brief Start time in seconds.
7220
+ * @type {number}
7221
+ */
7222
+ start: number;
7223
+ /** {zh}
7224
+ * @brief 结束时间,单位为秒。
7225
+ * @type {number}
7226
+ */
7227
+ /** {en}
7228
+ * @brief End time in seconds.
7229
+ * @type {number}
7230
+ */
7231
+ end: number;
7232
+ /** {zh}
7233
+ * @brief 字幕文案数组。
7234
+ * @type {string[]}
7235
+ */
7236
+ /** {en}
7237
+ * @brief Subtitle text array.
7238
+ * @type {string[]}
7239
+ */
7240
+ text: string[];
7241
+ /** {zh}
7242
+ * @brief 字幕顺序。
7243
+ * @type {number}
7244
+ */
7245
+ /** {en}
7246
+ * @brief Subtitle display order.
7247
+ * @type {number}
7248
+ */
7249
+ index?: number;
7250
+ }
7251
+ export type TLogChannel = "cn" | "va" | "sg";
8006
7252
  /** {zh}
8007
7253
  * @hidden
8008
7254
  * h265策略配置
@@ -8359,6 +7605,7 @@ declare function getMediaInfoCacheConfig(): NormalizedMediaInfoCacheConfig;
8359
7605
  export interface DramaIdentity {
8360
7606
  albumId: string | null;
8361
7607
  episodeId: string | null;
7608
+ vid: string | null;
8362
7609
  }
8363
7610
  export declare type PlayerPlaybackState = "creating" | "ready" | "playing" | "paused" | "buffering" | "ended" | "error" | "destroyed";
8364
7611
  export interface PlayerPlaybackStateSnapshot extends DramaIdentity {
@@ -8510,14 +7757,6 @@ declare class VePlayer {
8510
7757
  * @memberof VePlayer
8511
7758
  */
8512
7759
  private _emitter;
8513
- /** @hidden 当前播放内核对应的 Master M3U8 Level 控制器。 */
8514
- private _hlsMasterController;
8515
- /** @hidden 当前播放内核对应的 Master M3U8 字幕适配器。 */
8516
- private _hlsSubtitleAdapter;
8517
- /** @hidden 当前播放世代中业务显式配置的字幕列表快照。 */
8518
- private _explicitSubtitleListSnapshot;
8519
- /** @hidden 在播放会话提交后刷新 Level 快照与事件归属。 */
8520
- private _hlsMasterRefreshListener?;
8521
7760
  /** 最近一次用户选择的音轨,用于清晰度切换后通过 setAudioOption 恢复音轨 */
8522
7761
  private _lastSelectedAudioTrack;
8523
7762
  /**
@@ -9076,14 +8315,6 @@ declare class VePlayer {
9076
8315
  * @memberof VePlayer
9077
8316
  */
9078
8317
  afterPlayerCreate(): void;
9079
- /** @hidden 为当前播放内核挂载会话隔离的 Master M3U8 Level 控制器。 */
9080
- private _mountHlsMasterController;
9081
- /** @hidden 为当前 hls.js 播放会话挂载安全的 Master 字幕适配器。 */
9082
- private _mountHlsSubtitleAdapter;
9083
- /** @hidden 克隆业务字幕策略,避免由运行时注入列表反推来源。 */
9084
- private _cloneExplicitSubtitleList;
9085
- /** @hidden 返回稳定的 Level 会话刷新监听器,便于销毁时精确解绑。 */
9086
- private _getHlsMasterRefreshListener;
9087
8318
  _setVeError(): void;
9088
8319
  /**
9089
8320
  * @hidden
@@ -9404,171 +8635,6 @@ declare class VePlayer {
9404
8635
  selected: boolean;
9405
8636
  [propName: string]: any;
9406
8637
  }>;
9407
- /** {zh}
9408
- * @brief 获取当前播放会话中由 Master M3U8 解析出的 HLS Level 列表。
9409
- * @list Api
9410
- * @returns 标准化后的 HLS Level 快照;Manifest 未就绪或当前不是 hls.js 内核时返回空数组。
9411
- * @notes Level 的 `index` 只在当前 `playbackSessionId` 内有效;返回结果不包含播放地址和鉴权信息。
9412
- * @example
9413
- * ``` javascript
9414
- * const levels = playerSdkIns.getHlsLevels();
9415
- * console.log(levels.map(level => `${level.height}p`));
9416
- * ```
9417
- */
9418
- /** {en}
9419
- * @brief Get HLS Levels parsed from the Master M3U8 for the current playback session.
9420
- * @list Api
9421
- * @returns A normalized HLS Level snapshot. Returns an empty array before the manifest is ready or when hls.js is not the active engine.
9422
- * @notes A Level `index` is valid only for the current `playbackSessionId`. Playback URLs and authorization data are never returned.
9423
- * @example
9424
- * ``` javascript
9425
- * const levels = playerSdkIns.getHlsLevels();
9426
- * console.log(levels.map(level => `${level.height}p`));
9427
- * ```
9428
- */
9429
- getHlsLevels(): IHlsLevel[];
9430
- /** {zh}
9431
- * @brief 获取当前播放会话的 HLS Level 状态。
9432
- * @list Api
9433
- * @returns HLS Level 状态快照,包含列表就绪状态、实际档位、手动档位和自动选档上限。
9434
- * @notes `READY` 事件不表示 Level 列表已经就绪;请检查返回值的 `ready`,或监听 `HLS_LEVELS_UPDATED`。
9435
- * @example
9436
- * ``` javascript
9437
- * const state = playerSdkIns.getHlsLevelState();
9438
- * if (state.ready) {
9439
- * console.log(state.currentLevel, state.autoLevelEnabled);
9440
- * }
9441
- * ```
9442
- */
9443
- /** {en}
9444
- * @brief Get HLS Level state for the current playback session.
9445
- * @list Api
9446
- * @returns An HLS Level state snapshot including readiness, active and manual Levels, and the automatic Level cap.
9447
- * @notes The `READY` event does not mean the Level list is ready. Check `ready` or listen for `HLS_LEVELS_UPDATED`.
9448
- * @example
9449
- * ``` javascript
9450
- * const state = playerSdkIns.getHlsLevelState();
9451
- * if (state.ready) {
9452
- * console.log(state.currentLevel, state.autoLevelEnabled);
9453
- * }
9454
- * ```
9455
- */
9456
- getHlsLevelState(): IHlsLevelState;
9457
- /** {zh}
9458
- * @brief 手动切换当前 Master M3U8 的 HLS Level。
9459
- * @list Api
9460
- * @param levelIndex 目标 Level 索引,可通过 `getHlsLevels()` 获取。
9461
- * @param options 切换模式和可选的播放会话 ID。
9462
- * @notes 调用后进入手动选档。目标提交时触发 `HLS_LEVEL_SWITCHING`,实际生效后触发 `HLS_LEVEL_SWITCHED`。Manifest 未就绪、内核不支持、索引越界或会话过期时抛出 {@link HlsControlError}。
9463
- * @example
9464
- * ``` javascript
9465
- * const state = playerSdkIns.getHlsLevelState();
9466
- * playerSdkIns.setHlsLevel(1, {
9467
- * mode: 'next-fragment',
9468
- * playbackSessionId: state.playbackSessionId
9469
- * });
9470
- * ```
9471
- */
9472
- /** {en}
9473
- * @brief Manually switch the HLS Level in the current Master M3U8.
9474
- * @list Api
9475
- * @param levelIndex Target Level index from `getHlsLevels()`.
9476
- * @param options Switching mode and optional playback session ID.
9477
- * @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.
9478
- * @example
9479
- * ``` javascript
9480
- * const state = playerSdkIns.getHlsLevelState();
9481
- * playerSdkIns.setHlsLevel(1, {
9482
- * mode: 'next-fragment',
9483
- * playbackSessionId: state.playbackSessionId
9484
- * });
9485
- * ```
9486
- */
9487
- setHlsLevel(levelIndex: number, options?: IHlsLevelSwitchOptions): void;
9488
- /** {zh}
9489
- * @brief 获取当前播放会话的 HLS ABR 引擎、模式、可用性和控制能力。
9490
- * @list Api
9491
- * @returns 当前 HLS ABR 状态快照。
9492
- * @notes `engine` 是实际解析出的决策引擎;`configuredEngine` 只表示已生效的显式配置。请使用 `decisionSource` 决定清晰度 UI 展示 Level 还是 Definition。
9493
- * @example
9494
- * ``` javascript
9495
- * const state = playerSdkIns.getHlsAbrState();
9496
- * console.log(state.engine, state.mode, state.decisionSource);
9497
- * ```
9498
- */
9499
- /** {en}
9500
- * @brief Get the HLS ABR engine, mode, availability, and capabilities for the current playback session.
9501
- * @list Api
9502
- * @returns The current HLS ABR state snapshot.
9503
- * @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.
9504
- * @example
9505
- * ``` javascript
9506
- * const state = playerSdkIns.getHlsAbrState();
9507
- * console.log(state.engine, state.mode, state.decisionSource);
9508
- * ```
9509
- */
9510
- getHlsAbrState(): IHlsAbrState;
9511
- /** {zh}
9512
- * @brief 设置当前播放会话的 HLS ABR 自动或手动模式。
9513
- * @list Api
9514
- * @param mode ABR 模式。
9515
- * @notes 设置为 `auto` 时恢复当前已解析出的 ABR 引擎,不保证固定使用 hls.js。设置为 `manual` 本身不选择档位,需配合 `setHlsLevel()` 或 Definition API。
9516
- * @example
9517
- * ``` javascript
9518
- * playerSdkIns.setHlsAbrMode('auto');
9519
- * ```
9520
- */
9521
- /** {en}
9522
- * @brief Set automatic or manual HLS ABR mode for the current playback session.
9523
- * @list Api
9524
- * @param mode ABR mode.
9525
- * @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.
9526
- * @example
9527
- * ``` javascript
9528
- * playerSdkIns.setHlsAbrMode('auto');
9529
- * ```
9530
- */
9531
- setHlsAbrMode(mode: HlsAbrMode): void;
9532
- /** {zh}
9533
- * @brief 获取当前播放会话已设置的 HLS ABR 上限。
9534
- * @list Api
9535
- * @returns 当前上限的副本;未设置时返回 `null`。
9536
- * @example
9537
- * ``` javascript
9538
- * console.log(playerSdkIns.getHlsAbrLimit());
9539
- * ```
9540
- */
9541
- /** {en}
9542
- * @brief Get the HLS ABR limit configured for the current playback session.
9543
- * @list Api
9544
- * @returns A copy of the current limit, or `null` when no limit is set.
9545
- * @example
9546
- * ``` javascript
9547
- * console.log(playerSdkIns.getHlsAbrLimit());
9548
- * ```
9549
- */
9550
- getHlsAbrLimit(): IHlsAbrLimit;
9551
- /** {zh}
9552
- * @brief 设置或清除当前播放会话的 HLS ABR 上限。
9553
- * @list Api
9554
- * @param limit Level、码率或 Definition 上限;传入 `null` 清除上限。
9555
- * @notes 是否支持某种上限取决于 `getHlsAbrState().capabilities`;无法安全映射时抛出 {@link HlsControlError},原上限保持不变。
9556
- * @example
9557
- * ``` javascript
9558
- * playerSdkIns.setHlsAbrLimit({ type: 'bitrate', maxBitrate: 2500000 });
9559
- * ```
9560
- */
9561
- /** {en}
9562
- * @brief Set or clear the HLS ABR limit for the current playback session.
9563
- * @list Api
9564
- * @param limit A Level, bitrate, or Definition cap. Pass `null` to clear it.
9565
- * @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.
9566
- * @example
9567
- * ``` javascript
9568
- * playerSdkIns.setHlsAbrLimit({ type: 'bitrate', maxBitrate: 2500000 });
9569
- * ```
9570
- */
9571
- setHlsAbrLimit(limit: IHlsAbrLimit): void;
9572
8638
  /** {zh}
9573
8639
  * @brief 获取音频轨道列表。HLS 流通过 hls.js 获取,iOS 原生播放通过 HTMLMediaElement.audioTracks 获取。
9574
8640
  * @notes 每项包含 `id`、`name`、`lang`、`channels`、`default`、`selected` 字段;轨道数量 ≤ 1 时返回空数组。
@@ -9844,51 +8910,16 @@ declare class VePlayer {
9844
8910
  */
9845
8911
  getPlugin(pluginName: string): null | BasePlugin;
9846
8912
  /** {zh}
9847
- * @brief 获取当前字幕列表。
9848
- * @list Api
9849
- * @returns 当前字幕列表的副本;未注册 `Subtitle` 插件或列表未就绪时返回空数组。
9850
- * @notes Master M3U8 字幕项的 `source` 为 `hls`,不包含播放地址或底层轨道索引;业务显式配置的非空字幕列表优先。
9851
- * @example
9852
- * ``` javascript
9853
- * const subtitles = playerSdkIns.getSubtitleList();
9854
- * console.log(subtitles.map(item => item.text));
9855
- * ```
9856
- */
9857
- /** {en}
9858
- * @brief Get the current subtitle list.
9859
- * @list Api
9860
- * @returns A copy of the current subtitle list, or an empty array when the `Subtitle` plugin is unavailable or the list is not ready.
9861
- * @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.
9862
- * @example
9863
- * ``` javascript
9864
- * const subtitles = playerSdkIns.getSubtitleList();
9865
- * console.log(subtitles.map(item => item.text));
9866
- * ```
8913
+ * @brief 获取字幕列表。需配置 `Subtitle` 插件后调用。
8914
+ * @return 当前字幕列表,每项包含 `id`、`language`、`text`(显示名称)等字段。列表为空时返回空数组。
8915
+ * @memberof VePlayer
9867
8916
  */
9868
8917
  getSubtitleList(): ISubTitleItem[];
9869
8918
  /** {zh}
9870
- * @brief 切换当前字幕轨。
9871
- * @list Api
9872
- * @param subtitle 目标字幕的 `id` 或 `language`。优先精确匹配 `id`;仅按语言切换时必须唯一。
9873
- * @returns 切换成功时 resolve;未找到、语言不唯一、切换超时或播放会话失效时 reject。
9874
- * @notes hls.js 模式下,Promise 在播放内核确认目标字幕轨后才 resolve。
9875
- * @example
9876
- * ``` javascript
9877
- * const [subtitle] = playerSdkIns.getSubtitleList();
9878
- * if (subtitle) await playerSdkIns.switchSubtitle({ id: subtitle.id });
9879
- * ```
9880
- */
9881
- /** {en}
9882
- * @brief Switch the active subtitle track.
9883
- * @list Api
9884
- * @param subtitle Target subtitle `id` or `language`. Exact `id` matching takes precedence; a language-only match must be unique.
9885
- * @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.
9886
- * @notes In hls.js mode, the Promise resolves only after the playback engine confirms the target subtitle track.
9887
- * @example
9888
- * ``` javascript
9889
- * const [subtitle] = playerSdkIns.getSubtitleList();
9890
- * if (subtitle) await playerSdkIns.switchSubtitle({ id: subtitle.id });
9891
- * ```
8919
+ * @brief 切换字幕。需配置 `Subtitle` 插件后调用。
8920
+ * @param subtitle 目标字幕的 id 或 language,任意一个非空即可定位字幕项。
8921
+ * @return 切换成功时 resolve,失败(未找到、切换被中止)时 reject。
8922
+ * @memberof VePlayer
9892
8923
  */
9893
8924
  switchSubtitle(subtitle: {
9894
8925
  id?: string | number;
@@ -9896,36 +8927,12 @@ declare class VePlayer {
9896
8927
  }): Promise<void>;
9897
8928
  /** {zh}
9898
8929
  * @brief 开启字幕展示。恢复上次选中的字幕项;若从未选中过则默认选第一项。需配置 `Subtitle` 插件后调用。
9899
- * @list Api
9900
- * @example
9901
- * ``` javascript
9902
- * playerSdkIns.showSubtitle();
9903
- * ```
9904
- */
9905
- /** {en}
9906
- * @brief Show subtitles by restoring the last selected item, or the first item when none has been selected. Requires the `Subtitle` plugin.
9907
- * @list Api
9908
- * @example
9909
- * ``` javascript
9910
- * playerSdkIns.showSubtitle();
9911
- * ```
8930
+ * @memberof VePlayer
9912
8931
  */
9913
8932
  showSubtitle(): void;
9914
8933
  /** {zh}
9915
8934
  * @brief 关闭字幕展示。字幕数据保留,可通过 `showSubtitle` 重新开启。需配置 `Subtitle` 插件后调用。
9916
- * @list Api
9917
- * @example
9918
- * ``` javascript
9919
- * playerSdkIns.hideSubtitle();
9920
- * ```
9921
- */
9922
- /** {en}
9923
- * @brief Hide subtitles while retaining subtitle data so it can be restored with `showSubtitle`. Requires the `Subtitle` plugin.
9924
- * @list Api
9925
- * @example
9926
- * ``` javascript
9927
- * playerSdkIns.hideSubtitle();
9928
- * ```
8935
+ * @memberof VePlayer
9929
8936
  */
9930
8937
  hideSubtitle(): void;
9931
8938
  /** {zh}
@@ -10093,21 +9100,12 @@ export declare class LiveSubtitlesIconPlugin extends Plugin {
10093
9100
  destroy(): void;
10094
9101
  render(): string;
10095
9102
  }
10096
- export declare type NativeSubTitleOptions = {
10097
- nativeRenderMode?: "system" | "dom";
10098
- container?: HTMLElement;
10099
- style?: ISubtitleStyle;
10100
- playbackSessionId?: string;
10101
- emit?: (event: string, payload: unknown) => void;
10102
- createOpaqueId?: () => string;
10103
- };
10104
9103
  declare class NativeSubTitle extends EventEmitter {
10105
9104
  _media: any;
10106
9105
  _list: any[];
10107
9106
  _languages: string;
10108
9107
  curIndex: number;
10109
- private _domAdapter?;
10110
- constructor(media: any, options?: NativeSubTitleOptions);
9108
+ constructor(media: any);
10111
9109
  _init(): void;
10112
9110
  _onChange: (e: any) => void;
10113
9111
  /**
@@ -10121,8 +9119,6 @@ declare class NativeSubTitle extends EventEmitter {
10121
9119
  switch(data: any): Promise<unknown>;
10122
9120
  switchOff(): void;
10123
9121
  destroy(): void;
10124
- refresh(): void;
10125
- setPlaybackSessionId(playbackSessionId: string): void;
10126
9122
  }
10127
9123
  export interface IPanelItem {
10128
9124
  showText: string;
@@ -10154,7 +9150,6 @@ export declare class Subtitle extends Plugin {
10154
9150
  };
10155
9151
  isShowIcon: boolean;
10156
9152
  mode: string;
10157
- nativeRenderMode: string;
10158
9153
  updateMode: string;
10159
9154
  };
10160
9155
  private _delegates;
@@ -10167,11 +9162,6 @@ export declare class Subtitle extends Plugin {
10167
9162
  player: Player & {
10168
9163
  _subTitles?: NativeSubTitle | SubTitles;
10169
9164
  };
10170
- private _hideListTimer;
10171
- private _optionListEnterHandler?;
10172
- private _optionListLeaveHandler?;
10173
- private _runtimeSubtitleSource;
10174
- private _runtimeSubtitleBridge?;
10175
9165
  afterCreate(): void;
10176
9166
  /**
10177
9167
  * @description 初始化原生字幕
@@ -10183,7 +9173,6 @@ export declare class Subtitle extends Plugin {
10183
9173
  * @param {number} defaultIndex
10184
9174
  */
10185
9175
  _initExtSubTitle(defaultIndex: any): void;
10186
- private protectExtSubtitleCoreEvents;
10187
9176
  _renderList(defaultIndex: any): void;
10188
9177
  _onOff: () => void;
10189
9178
  _onChange: (data: any) => void;
@@ -10191,30 +9180,15 @@ export declare class Subtitle extends Plugin {
10191
9180
  updateCurItem(cIndex: any, subtitle: any): void;
10192
9181
  initEvents(): void;
10193
9182
  handleButtonChange: (e: any) => void;
10194
- private runUiSubtitleAction;
10195
9183
  onEnter: (e: any) => void;
10196
9184
  onLeave: (e: any) => void;
10197
- private clearPendingListHide;
10198
- private scheduleListHide;
10199
- private bindOptionListHoverEvents;
10200
- private unbindOptionListHoverEvents;
10201
9185
  showList(): void;
10202
9186
  hideList(): void;
10203
9187
  openSubtitle(): Promise<any>;
10204
- getSubTitleIndex(list: ISubTitleItem[], subtitle?: Pick<ISubTitleItem, "id" | "language">): number;
10205
- setRuntimeSubtitleSource(source: "config" | "hls"): void;
10206
- setRuntimeSubtitleBridge(bridge?: {
10207
- switchSubtitle: (subtitle: {
10208
- id?: string | number;
10209
- language?: string | number;
10210
- }) => Promise<void>;
10211
- hide: () => void;
10212
- show: () => Promise<void>;
10213
- }): void;
10214
- replaceRuntimeSubtitleList(list: ISubTitleItem[], isOpen: boolean): void;
10215
- confirmRuntimeSubtitleSelection(item: ISubTitleItem | null): void;
10216
- syncRuntimeSubtitleRenderer(runtimeIndex: number): void;
10217
- clearRuntimeSubtitleView(): void;
9188
+ getSubTitleIndex(list: any, subtitle?: {
9189
+ id: string;
9190
+ language: string;
9191
+ }): number;
10218
9192
  registerIcons(): {
10219
9193
  vttSubOpen: {
10220
9194
  icon: string;
@@ -10245,7 +9219,6 @@ export declare class Subtitle extends Plugin {
10245
9219
  "zh-hk": string;
10246
9220
  };
10247
9221
  };
10248
- updateLang(lang: string): void;
10249
9222
  creatOptionList(): void;
10250
9223
  getList(): any;
10251
9224
  renderOptionList(): void;
@@ -10993,69 +9966,6 @@ export declare const Events: {
10993
9966
  * @brief Triggered when audio track switching completes. `data.id` is the new track id; `data.audioTrack` is the full track object.
10994
9967
  */
10995
9968
  AUDIO_TRACK_CHANGE: string;
10996
- /** {zh}
10997
- * @brief 当前播放会话的 HLS Level 列表或状态更新。
10998
- */
10999
- /** {en}
11000
- * @brief Triggered when the HLS Level list or state updates for the current playback session.
11001
- */
11002
- HLS_LEVELS_UPDATED: string;
11003
- /** {zh}
11004
- * @brief HLS Level 切换请求已提交给播放内核;不表示画面已经切换。
11005
- */
11006
- /** {en}
11007
- * @brief Triggered after an HLS Level switch is submitted to the playback engine; the rendered Level may not have changed yet.
11008
- */
11009
- HLS_LEVEL_SWITCHING: string;
11010
- /** {zh}
11011
- * @brief HLS Level 已实际切换。
11012
- */
11013
- /** {en}
11014
- * @brief Triggered after the active HLS Level has actually switched.
11015
- */
11016
- HLS_LEVEL_SWITCHED: string;
11017
- /** {zh}
11018
- * @brief 当前播放会话的 HLS ABR 决策引擎解析完成。
11019
- */
11020
- /** {en}
11021
- * @brief Triggered after the HLS ABR decision engine is resolved for the current playback session.
11022
- */
11023
- HLS_ABR_ENGINE_RESOLVED: string;
11024
- /** {zh}
11025
- * @brief HLS ABR 的可用性、自动/手动模式或激活状态发生变化。
11026
- */
11027
- /** {en}
11028
- * @brief Triggered when HLS ABR availability, auto/manual mode, or active state changes.
11029
- */
11030
- HLS_ABR_STATE_CHANGE: string;
11031
- /** {zh}
11032
- * @brief HLS ABR 上限发生变化。
11033
- */
11034
- /** {en}
11035
- * @brief Triggered when the HLS ABR cap changes.
11036
- */
11037
- HLS_ABR_LIMIT_CHANGE: string;
11038
- /** {zh}
11039
- * @brief 当前播放会话从 Master M3U8 或原生 TextTrack 获得的字幕列表更新。
11040
- */
11041
- /** {en}
11042
- * @brief Triggered when the subtitle list sourced from a Master M3U8 or native TextTracks updates for the current playback session.
11043
- */
11044
- HLS_SUBTITLE_TRACKS_UPDATED: string;
11045
- /** {zh}
11046
- * @brief HLS 字幕轨切换请求已提交;不表示字幕轨已经生效。
11047
- */
11048
- /** {en}
11049
- * @brief Triggered after an HLS subtitle-track switch is submitted; the track may not be active yet.
11050
- */
11051
- HLS_SUBTITLE_TRACK_SWITCHING: string;
11052
- /** {zh}
11053
- * @brief HLS 字幕轨切换已经生效。
11054
- */
11055
- /** {en}
11056
- * @brief Triggered after an HLS subtitle-track switch takes effect.
11057
- */
11058
- HLS_SUBTITLE_TRACK_SWITCHED: string;
11059
9969
  /** {zh}
11060
9970
  * @brief 在播放被终止时触发。例如当播放中的视频重新开始播放。
11061
9971
  */
@@ -11501,69 +10411,6 @@ export declare const Event: {
11501
10411
  * @brief Triggered when audio track switching completes. `data.id` is the new track id; `data.audioTrack` is the full track object.
11502
10412
  */
11503
10413
  AUDIO_TRACK_CHANGE: string;
11504
- /** {zh}
11505
- * @brief 当前播放会话的 HLS Level 列表或状态更新。
11506
- */
11507
- /** {en}
11508
- * @brief Triggered when the HLS Level list or state updates for the current playback session.
11509
- */
11510
- HLS_LEVELS_UPDATED: string;
11511
- /** {zh}
11512
- * @brief HLS Level 切换请求已提交给播放内核;不表示画面已经切换。
11513
- */
11514
- /** {en}
11515
- * @brief Triggered after an HLS Level switch is submitted to the playback engine; the rendered Level may not have changed yet.
11516
- */
11517
- HLS_LEVEL_SWITCHING: string;
11518
- /** {zh}
11519
- * @brief HLS Level 已实际切换。
11520
- */
11521
- /** {en}
11522
- * @brief Triggered after the active HLS Level has actually switched.
11523
- */
11524
- HLS_LEVEL_SWITCHED: string;
11525
- /** {zh}
11526
- * @brief 当前播放会话的 HLS ABR 决策引擎解析完成。
11527
- */
11528
- /** {en}
11529
- * @brief Triggered after the HLS ABR decision engine is resolved for the current playback session.
11530
- */
11531
- HLS_ABR_ENGINE_RESOLVED: string;
11532
- /** {zh}
11533
- * @brief HLS ABR 的可用性、自动/手动模式或激活状态发生变化。
11534
- */
11535
- /** {en}
11536
- * @brief Triggered when HLS ABR availability, auto/manual mode, or active state changes.
11537
- */
11538
- HLS_ABR_STATE_CHANGE: string;
11539
- /** {zh}
11540
- * @brief HLS ABR 上限发生变化。
11541
- */
11542
- /** {en}
11543
- * @brief Triggered when the HLS ABR cap changes.
11544
- */
11545
- HLS_ABR_LIMIT_CHANGE: string;
11546
- /** {zh}
11547
- * @brief 当前播放会话从 Master M3U8 或原生 TextTrack 获得的字幕列表更新。
11548
- */
11549
- /** {en}
11550
- * @brief Triggered when the subtitle list sourced from a Master M3U8 or native TextTracks updates for the current playback session.
11551
- */
11552
- HLS_SUBTITLE_TRACKS_UPDATED: string;
11553
- /** {zh}
11554
- * @brief HLS 字幕轨切换请求已提交;不表示字幕轨已经生效。
11555
- */
11556
- /** {en}
11557
- * @brief Triggered after an HLS subtitle-track switch is submitted; the track may not be active yet.
11558
- */
11559
- HLS_SUBTITLE_TRACK_SWITCHING: string;
11560
- /** {zh}
11561
- * @brief HLS 字幕轨切换已经生效。
11562
- */
11563
- /** {en}
11564
- * @brief Triggered after an HLS subtitle-track switch takes effect.
11565
- */
11566
- HLS_SUBTITLE_TRACK_SWITCHED: string;
11567
10414
  };
11568
10415
  PluginEvents: {
11569
10416
  /** {zh}