This commit is contained in:
ct
2025-07-03 02:47:11 +08:00
parent 2f9f34ebc7
commit 08935c8a82
3 changed files with 171 additions and 33 deletions

View File

@@ -5,6 +5,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
// Import centralized font management
import { getFontStyle, loadTimelineFonts, WATERMARK_CONFIG } from '@/modules/editor/fonts';
import { toast } from 'sonner';
const useVideoExport = ({ timelineElements, dimensions, totalDuration, watermarked = false }) => {
const [showConsoleLogs] = useState(true);
@@ -542,7 +543,7 @@ const useVideoExport = ({ timelineElements, dimensions, totalDuration, watermark
setExportStatus('Starting export...');
try {
setExportStatus('Loading FFmpeg...');
setExportStatus('Setting up...');
const ffmpeg = new FFmpeg();
@@ -710,7 +711,10 @@ const useVideoExport = ({ timelineElements, dimensions, totalDuration, watermark
path: error.path,
error: error,
});
setExportStatus(`Failed: ${error.message}`);
setExportStatus('Export failed.');
toast.error('Export failed. Please try again! If the problem persists, please contact us.');
} finally {
setTimeout(() => {
setIsExporting(false);