Update
This commit is contained in:
@@ -217,6 +217,7 @@ const VideoEditor = ({ width, height, onOpenTextSidebar }) => {
|
||||
timelineElements,
|
||||
dimensions,
|
||||
totalDuration,
|
||||
watermarked,
|
||||
});
|
||||
|
||||
const setupVideos = () => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
// Import centralized font management
|
||||
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 [isExporting, setIsExporting] = useState(false);
|
||||
@@ -597,15 +597,16 @@ const useVideoExport = ({ timelineElements, dimensions, totalDuration }) => {
|
||||
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;
|
||||
// Uncomment if you have watermarked prop available:
|
||||
// if (watermarked) {
|
||||
// const watermarkDataURL = await renderWatermarkToImage(dimensions);
|
||||
// const watermarkImageData = await fetchFile(watermarkDataURL);
|
||||
// watermarkFileName = 'watermark.png';
|
||||
// await ffmpeg.writeFile(watermarkFileName, watermarkImageData);
|
||||
// }
|
||||
if (watermarked) {
|
||||
showConsoleLogs && console.log('🏷️ Rendering watermark for export');
|
||||
const watermarkDataURL = await renderWatermarkToImage(dimensions);
|
||||
const watermarkImageData = await fetchFile(watermarkDataURL);
|
||||
watermarkFileName = 'watermark.png';
|
||||
await ffmpeg.writeFile(watermarkFileName, watermarkImageData);
|
||||
showConsoleLogs && console.log('✅ Watermark saved to FFmpeg filesystem');
|
||||
}
|
||||
|
||||
setExportProgress(30);
|
||||
showConsoleLogs && console.log('✅ All text elements rendered to images');
|
||||
|
||||
Reference in New Issue
Block a user