fix(CGTaskCard): 合成视频时使用最新的字幕记录

This commit is contained in:
2025-10-27 09:50:54 +08:00
parent f88e053a44
commit d748306ab3
2 changed files with 17 additions and 3 deletions

View File

@@ -145,10 +145,24 @@ const copyTaskId = (extraMessage?: string) => {
const isCombinationModalOpen = ref(false)
const combinationState = ref<0 | 1 | undefined>(0)
const onCombination = () => {
const onCombination = async () => {
isCombinationModalOpen.value = true
combinationState.value = undefined
useVideoSubtitleEmbedding(props.course.video_url, props.course.subtitle_url)
const srtResponse = await (
await fetch(await fetchCourseSubtitleUrl(props.course))
).blob()
if (!srtResponse) {
toast.add({
title: '获取字幕失败',
description: '无法获取字幕文件,请稍后重试',
color: 'red',
icon: 'i-tabler-alert-triangle',
})
return
}
const srtBlob = new Blob([srtResponse], { type: 'text/plain' })
const srtUrl = URL.createObjectURL(srtBlob)
useVideoSubtitleEmbedding(props.course.video_url, srtUrl)
.then((src) => {
startDownload(
src,