fix(CGTaskCard): 合成视频时使用最新的字幕记录
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user