fix: 封面API去除body重复template_id+片段切换后重启tick #1434

Closed
xiaoxia wants to merge 1 commits from fix/preview-player-v8 into develop
2 changed files with 6 additions and 8 deletions
+4 -8
View File
@@ -23,13 +23,9 @@ export async function generateCover(
templateId: string,
data: GenerateCoverRequest,
): Promise<GenerateCoverResponse> {
const response = await apiClient.post<GenerateCoverResponse>(
"/generation/generate-cover",
{ ...data, template_id: templateId },
{
timeout: 300000,
params: { template_id: templateId },
},
)
const response = await apiClient.post<GenerateCoverResponse>("/generation/generate-cover", data, {
timeout: 300000,
params: { template_id: templateId },
})
return response.data
}
@@ -184,6 +184,8 @@ export function useSegmentScheduler(segments: PlaybackSegment[]): SegmentSchedul
const nextIndex = currentSegmentIndex + 1
if (nextIndex < segments.length) {
switchToSegment(nextIndex).then(() => {
setIsPlaying(true)
rafRef.current = requestAnimationFrame(tick)
const nextVideo = videoRefs.current[nextIndex]
if (nextVideo) {
nextVideo