fix: 预览生成标题参数改用title_config对象匹配后端Schema #1381

Closed
xiaoxia wants to merge 1 commits from fix/title-config-param-mapping into develop
2 changed files with 24 additions and 18 deletions
+11 -9
View File
@@ -13,15 +13,17 @@ export interface CreatePreviewRequest {
video_title?: string
duration?: number
video_ratio?: string
/* 标题烧录参数(可选,传入后 ASS 渲染标题到预览视频中) */
title_text?: string
title_font?: string
title_size?: number
title_color?: string
title_position?: string
title_bold?: boolean
title_stroke?: boolean
title_shadow?: boolean
/* 标题烧录配置(可选,传入后 ASS 渲染标题到预览视频中) */
title_config?: {
text?: string
font?: string
font_size?: number
font_color?: string
position?: string
bold?: boolean
stroke?: boolean
shadow?: boolean
}
bgm_config?: {
enabled: boolean
preset_id?: string
@@ -358,15 +358,19 @@ export function useStep5Preview({
video_ratio: videoRatio,
voice_ids: voiceIds && voiceIds.length > 0 ? voiceIds : undefined,
voice_library_id: voiceLibraryId || undefined,
// 标题信息
title_text: titleSettings?.title || undefined,
title_font: titleSettings?.font || undefined,
title_size: titleSettings?.size || undefined,
title_color: titleSettings?.color || undefined,
title_position: titleSettings?.position || undefined,
title_bold: titleSettings?.bold || undefined,
title_stroke: titleSettings?.stroke || undefined,
title_shadow: titleSettings?.shadow || undefined,
// 标题烧录配置
title_config: titleSettings?.title
? {
text: titleSettings.title,
font: titleSettings.font,
font_size: titleSettings.size,
font_color: titleSettings.color,
position: titleSettings.position,
bold: titleSettings.bold,
stroke: titleSettings.stroke,
shadow: titleSettings.shadow,
}
: undefined,
})
if (startTimeRef.current === 0) return