@volcengine/veplayer 1.20.1-rc.5 → 1.20.1-rc.7
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 +36 -6
- package/index.min.js +2 -2
- package/lite.cjs +2 -2
- package/lite.d.ts +12 -4
- package/lite.esm.mjs +2 -2
- package/lite.min.js +2 -2
- package/package.json +1 -1
- package/plugin/modules/DashAbralgo.mjs +1 -1
- package/plugin/modules/XGVideo.mjs +1 -1
- package/plugin/modules/danmuMask.mjs +1 -1
- package/plugin/modules/danmujs.mjs +1 -1
- package/plugin/modules/dash.mjs +1 -1
- package/plugin/modules/flv.mjs +1 -1
- package/plugin/modules/hls.mjs +1 -1
- package/plugin/modules/hlsEncrypt.mjs +1 -1
- package/plugin/modules/hlsjs.mjs +1 -1
- package/plugin/modules/hlsjsPro.mjs +1 -1
- package/plugin/modules/mp4Encrypt.mjs +1 -1
- package/plugin/modules/preloader.mjs +1 -1
- package/plugin/modules/streamprobe.mjs +1 -1
- package/plugin/modules/vestrategy.mjs +1 -1
- package/plugin/modules/vestrategy_adapt_range.mjs +1 -1
- package/plugin/modules/vestrategy_h265.mjs +1 -1
- package/plugin/modules/vestrategy_preload.mjs +1 -1
package/index.d.ts
CHANGED
|
@@ -597,6 +597,11 @@ export declare type SubtitleEditorContext = {
|
|
|
597
597
|
totalCues: number;
|
|
598
598
|
containerBox: DOMRectReadOnly;
|
|
599
599
|
paddedOverlay: HTMLElement;
|
|
600
|
+
} | {
|
|
601
|
+
type: "cue-final";
|
|
602
|
+
cue: ISubtitleCue;
|
|
603
|
+
cueIndex: number;
|
|
604
|
+
totalCues: number;
|
|
600
605
|
} | {
|
|
601
606
|
type: "region";
|
|
602
607
|
regionContainer: HTMLElement;
|
|
@@ -611,12 +616,12 @@ export declare type SubtitleEditorContext = {
|
|
|
611
616
|
overlayEl: HTMLElement;
|
|
612
617
|
};
|
|
613
618
|
/** {zh}
|
|
614
|
-
* @brief WebVTT
|
|
615
|
-
* @notes cue 和 region 可直接改 DOM 或返回样式。style 返回对象按类名及属性合并,返回数组替换全部样式。
|
|
619
|
+
* @brief WebVTT 编辑回调。cue 和 cue-final 回调提供 styleBox。
|
|
620
|
+
* @notes cue、cue-final 和 region 可直接改 DOM 或返回样式。cue-final 的样式在 cue 阶段之后生效。style 返回对象按类名及属性合并,返回数组替换全部样式。
|
|
616
621
|
*/
|
|
617
622
|
/** {en}
|
|
618
|
-
* @brief WebVTT editor.
|
|
619
|
-
* @notes
|
|
623
|
+
* @brief WebVTT editor. The cue and cue-final callbacks receive a style box.
|
|
624
|
+
* @notes The cue, cue-final, and region callbacks may edit DOM or return styles. Cue-final styles apply after cue edits. Return an object from style to merge declarations by class, or an array to replace all styles.
|
|
620
625
|
*/
|
|
621
626
|
export declare type SubtitleEditor = (styleBox: ISubtitleStyleBox | undefined, context: SubtitleEditorContext) => ISubtitleCueStyle | SubtitleCss | SubtitleStyleBlock | readonly SubtitleStyleBlock[] | void;
|
|
622
627
|
/** {zh}
|
|
@@ -803,17 +808,36 @@ export interface ISubtitleConfig {
|
|
|
803
808
|
subtitleStyleConfig?: ISubtitleStyleConfig;
|
|
804
809
|
/** {zh}
|
|
805
810
|
* @brief 编辑 WebVTT 字幕、区域和样式块。字幕编辑可覆盖全局样式。
|
|
811
|
+
* @notes 启用 enableSubtitleCueFinal 后,可在 cue-final 阶段测量字幕 DOM 并应用最终样式。
|
|
806
812
|
* @example
|
|
807
813
|
* Subtitle: { subtitleEditor: (_, context) =>
|
|
808
814
|
* context.type === 'cue' ? { textStyle: { fontWeight: 'bold' } } : undefined }
|
|
809
815
|
*/
|
|
810
816
|
/** {en}
|
|
811
817
|
* @brief Edit WebVTT cues, regions, and style blocks. Cue edits can override shared styles.
|
|
818
|
+
* @notes Enable enableSubtitleCueFinal to measure cue DOM and apply final styles in the cue-final phase.
|
|
812
819
|
* @example
|
|
813
820
|
* Subtitle: { subtitleEditor: (_, context) =>
|
|
814
821
|
* context.type === 'cue' ? { textStyle: { fontWeight: 'bold' } } : undefined }
|
|
815
822
|
*/
|
|
816
823
|
subtitleEditor?: SubtitleEditor;
|
|
824
|
+
/** {zh}
|
|
825
|
+
* @brief 启用点播外挂 WebVTT 字幕的 cue-final 编辑回调。
|
|
826
|
+
* @default false
|
|
827
|
+
* @notes 在当批字幕挂载并完成 cue 阶段的编辑和定位后调用。字幕覆盖层尺寸改变时,重新渲染当前字幕并调用。
|
|
828
|
+
* @example
|
|
829
|
+
* Subtitle: { enableSubtitleCueFinal: true, subtitleEditor: (_, context) =>
|
|
830
|
+
* context.type === 'cue-final' ? { textStyle: { lineHeight: '1.374' } } : undefined }
|
|
831
|
+
*/
|
|
832
|
+
/** {en}
|
|
833
|
+
* @brief Enable the cue-final editor callback for external VOD WebVTT captions.
|
|
834
|
+
* @default false
|
|
835
|
+
* @notes Runs after the batch is attached and cue edits and positioning are applied. A change in overlay size redraws the active cues and invokes the callback again.
|
|
836
|
+
* @example
|
|
837
|
+
* Subtitle: { enableSubtitleCueFinal: true, subtitleEditor: (_, context) =>
|
|
838
|
+
* context.type === 'cue-final' ? { textStyle: { lineHeight: '1.374' } } : undefined }
|
|
839
|
+
*/
|
|
840
|
+
enableSubtitleCueFinal?: boolean;
|
|
817
841
|
}
|
|
818
842
|
/** {zh}
|
|
819
843
|
* @list Options
|
|
@@ -9693,7 +9717,7 @@ declare class VePlayer {
|
|
|
9693
9717
|
afterPlayerCreate(): void;
|
|
9694
9718
|
/** @hidden 为当前播放内核挂载会话隔离的 Master M3U8 Level 控制器。 */
|
|
9695
9719
|
private _mountHlsMasterController;
|
|
9696
|
-
/** @hidden 为当前
|
|
9720
|
+
/** @hidden 为当前 HLS 播放会话挂载 Master 字幕适配器。 */
|
|
9697
9721
|
private _mountHlsSubtitleAdapter;
|
|
9698
9722
|
/** @hidden 克隆业务字幕策略,避免由运行时注入列表反推来源。 */
|
|
9699
9723
|
private _cloneExplicitSubtitleList;
|
|
@@ -10806,6 +10830,7 @@ export declare class Subtitle extends Plugin {
|
|
|
10806
10830
|
private _optionListLeaveHandler?;
|
|
10807
10831
|
private webVttPlayback?;
|
|
10808
10832
|
private webVttHls?;
|
|
10833
|
+
private nativeHlsSubtitle?;
|
|
10809
10834
|
private _runtimeSubtitleSource;
|
|
10810
10835
|
private _runtimeSubtitleBridge?;
|
|
10811
10836
|
afterCreate(): void;
|
|
@@ -10841,6 +10866,10 @@ export declare class Subtitle extends Plugin {
|
|
|
10841
10866
|
setRuntimeSubtitleSource(source: "config" | "hls"): void;
|
|
10842
10867
|
/** @hidden Connect the custom renderer to the current hls.js instance. */
|
|
10843
10868
|
setWebVttHls(hls?: HlsRuntimeLike): void;
|
|
10869
|
+
/** @hidden Read Master subtitles from the native video element in external mode. */
|
|
10870
|
+
setNativeHlsSubtitleSession(sessionId?: string, options?: ISubtitleConfig): void;
|
|
10871
|
+
/** @hidden Restore the native track that was selected before hiding subtitles. */
|
|
10872
|
+
showNativeHlsSubtitle(): boolean;
|
|
10844
10873
|
setRuntimeSubtitleBridge(bridge?: {
|
|
10845
10874
|
switchSubtitle: (subtitle: {
|
|
10846
10875
|
id?: string | number;
|
|
@@ -10849,7 +10878,7 @@ export declare class Subtitle extends Plugin {
|
|
|
10849
10878
|
hide: () => void;
|
|
10850
10879
|
show: () => Promise<void>;
|
|
10851
10880
|
}): void;
|
|
10852
|
-
replaceRuntimeSubtitleList(list: ISubTitleItem[], isOpen: boolean): void;
|
|
10881
|
+
replaceRuntimeSubtitleList(list: ISubTitleItem[], isOpen: boolean, selectedId?: ISubTitleItem["id"] | null): void;
|
|
10853
10882
|
confirmRuntimeSubtitleSelection(item: ISubTitleItem | null): void;
|
|
10854
10883
|
syncRuntimeSubtitleRenderer(runtimeIndex: number): void;
|
|
10855
10884
|
clearRuntimeSubtitleView(): void;
|
|
@@ -10906,6 +10935,7 @@ export declare class Subtitle extends Plugin {
|
|
|
10906
10935
|
updateList(data?: {
|
|
10907
10936
|
list?: any[];
|
|
10908
10937
|
isOpen?: boolean;
|
|
10938
|
+
selectedId?: ISubTitleItem["id"] | null;
|
|
10909
10939
|
}): void;
|
|
10910
10940
|
changeTipText(): void;
|
|
10911
10941
|
showMobilePanel(): void;
|