This commit is contained in:
ct
2025-06-28 13:27:10 +08:00
parent fe1066583a
commit b682407a33
3 changed files with 12 additions and 9 deletions

View File

@@ -217,6 +217,7 @@ const VideoEditor = ({ width, height, onOpenTextSidebar }) => {
timelineElements, timelineElements,
dimensions, dimensions,
totalDuration, totalDuration,
watermarked,
}); });
const setupVideos = () => { const setupVideos = () => {

View File

@@ -6,7 +6,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
// Import centralized font management // Import centralized font management
import { getFontStyle, loadTimelineFonts, WATERMARK_CONFIG } from '@/modules/editor/fonts'; import { getFontStyle, loadTimelineFonts, WATERMARK_CONFIG } from '@/modules/editor/fonts';
const useVideoExport = ({ timelineElements, dimensions, totalDuration }) => { const useVideoExport = ({ timelineElements, dimensions, totalDuration, watermarked = false }) => {
const [showConsoleLogs] = useState(true); const [showConsoleLogs] = useState(true);
const [isExporting, setIsExporting] = useState(false); const [isExporting, setIsExporting] = useState(false);
@@ -597,15 +597,16 @@ const useVideoExport = ({ timelineElements, dimensions, totalDuration }) => {
setExportProgress(15 + Math.round((i / texts.length) * 15)); setExportProgress(15 + Math.round((i / texts.length) * 15));
} }
// Render watermark if needed (you'll need to pass watermarked prop) // Render watermark if needed
let watermarkFileName = null; let watermarkFileName = null;
// Uncomment if you have watermarked prop available: if (watermarked) {
// if (watermarked) { showConsoleLogs && console.log('🏷️ Rendering watermark for export');
// const watermarkDataURL = await renderWatermarkToImage(dimensions); const watermarkDataURL = await renderWatermarkToImage(dimensions);
// const watermarkImageData = await fetchFile(watermarkDataURL); const watermarkImageData = await fetchFile(watermarkDataURL);
// watermarkFileName = 'watermark.png'; watermarkFileName = 'watermark.png';
// await ffmpeg.writeFile(watermarkFileName, watermarkImageData); await ffmpeg.writeFile(watermarkFileName, watermarkImageData);
// } showConsoleLogs && console.log('✅ Watermark saved to FFmpeg filesystem');
}
setExportProgress(30); setExportProgress(30);
showConsoleLogs && console.log('✅ All text elements rendered to images'); showConsoleLogs && console.log('✅ All text elements rendered to images');

View File

@@ -16,6 +16,7 @@ export default defineConfig({
], ],
esbuild: { esbuild: {
jsx: 'automatic', jsx: 'automatic',
drop: ["console", "debugger"],
}, },
resolve: { resolve: {
alias: { alias: {