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 isCombinationModalOpen = ref(false)
const combinationState = ref<0 | 1 | undefined>(0) const combinationState = ref<0 | 1 | undefined>(0)
const onCombination = () => { const onCombination = async () => {
isCombinationModalOpen.value = true isCombinationModalOpen.value = true
combinationState.value = undefined 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) => { .then((src) => {
startDownload( startDownload(
src, src,

View File

@@ -10,7 +10,7 @@
"preview": "nuxt preview", "preview": "nuxt preview",
"postinstall": "nuxt prepare" "postinstall": "nuxt prepare"
}, },
"packageManager": "pnpm@9.1.3", "packageManager": "pnpm@10.19.0",
"dependencies": { "dependencies": {
"@iconify-json/line-md": "^1.1.38", "@iconify-json/line-md": "^1.1.38",
"@iconify-json/solar": "^1.1.9", "@iconify-json/solar": "^1.1.9",