@volcengine/veplayer 1.20.1-rc.5 → 1.20.1-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/lite.d.ts CHANGED
@@ -115,6 +115,11 @@ export type SubtitleEditorContext = {
115
115
  totalCues: number;
116
116
  containerBox: DOMRectReadOnly;
117
117
  paddedOverlay: HTMLElement;
118
+ } | {
119
+ type: "cue-final";
120
+ cue: ISubtitleCue;
121
+ cueIndex: number;
122
+ totalCues: number;
118
123
  } | {
119
124
  type: "region";
120
125
  regionContainer: HTMLElement;
@@ -129,12 +134,12 @@ export type SubtitleEditorContext = {
129
134
  overlayEl: HTMLElement;
130
135
  };
131
136
  /** {zh}
132
- * @brief WebVTT 编辑回调。仅 cue 回调提供 styleBox。
133
- * @notes cue 和 region 可直接改 DOM 或返回样式。style 返回对象按类名及属性合并,返回数组替换全部样式。
137
+ * @brief WebVTT 编辑回调。cue 和 cue-final 回调提供 styleBox。
138
+ * @notes cue、cue-final 和 region 可直接改 DOM 或返回样式。cue-final 的样式在 cue 阶段之后生效。style 返回对象按类名及属性合并,返回数组替换全部样式。
134
139
  */
135
140
  /** {en}
136
- * @brief WebVTT editor. Only the cue callback receives a style box.
137
- * @notes Cue and region callbacks may edit DOM or return styles. Return an object from style to merge declarations by class, or an array to replace all styles.
141
+ * @brief WebVTT editor. The cue and cue-final callbacks receive a style box.
142
+ * @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.
138
143
  */
139
144
  export type SubtitleEditor = (styleBox: ISubtitleStyleBox | undefined, context: SubtitleEditorContext) => ISubtitleCueStyle | SubtitleCss | SubtitleStyleBlock | readonly SubtitleStyleBlock[] | void;
140
145
  interface ISubtitleStyle {
@@ -1619,6 +1624,9 @@ export interface LiteSubtitleConfig {
1619
1624
  /** @deprecated Use style.cueBoxStyle and style.textStyle. */
1620
1625
  subtitleStyleConfig?: ISubtitleStyleConfig;
1621
1626
  subtitleEditor?: SubtitleEditor;
1627
+ /** {zh} @brief 启用布局后的 cue-final 字幕编辑回调,默认关闭。 */
1628
+ /** {en} @brief Enable the cue-final subtitle editor after layout. Defaults to false. */
1629
+ enableSubtitleCueFinal?: boolean;
1622
1630
  defaultSubtitleId?: string | number;
1623
1631
  defaultSubtitleLanguage?: string | number;
1624
1632
  mode?: "external" | "native";