Skip to content

Commit 70a9bfe

Browse files
committed
feat: add audio support for export
1 parent d4e08bb commit 70a9bfe

File tree

3 files changed

+336
-164
lines changed

3 files changed

+336
-164
lines changed

apps/web/src/components/editor/export-button.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Button } from "../ui/button";
77
import { Label } from "../ui/label";
88
import { RadioGroup, RadioGroupItem } from "../ui/radio-group";
99
import { Progress } from "../ui/progress";
10+
import { Checkbox } from "../ui/checkbox";
1011
import { cn } from "@/lib/utils";
1112
import {
1213
exportProject,
@@ -75,6 +76,9 @@ function ExportPopover({
7576
const [quality, setQuality] = useState<ExportQuality>(
7677
DEFAULT_EXPORT_OPTIONS.quality
7778
);
79+
const [includeAudio, setIncludeAudio] = useState<boolean>(
80+
DEFAULT_EXPORT_OPTIONS.includeAudio || true
81+
);
7882
const [isExporting, setIsExporting] = useState(false);
7983
const [progress, setProgress] = useState(0);
8084
const [exportResult, setExportResult] = useState<ExportResult | null>(null);
@@ -90,6 +94,7 @@ function ExportPopover({
9094
format,
9195
quality,
9296
fps: activeProject.fps,
97+
includeAudio,
9398
onProgress: setProgress,
9499
onCancel: () => false, // TODO: Add cancel functionality
95100
});
@@ -197,6 +202,23 @@ function ExportPopover({
197202
</div>
198203
</RadioGroup>
199204
</PropertyGroup>
205+
206+
<PropertyGroup
207+
title="Audio"
208+
titleClassName="text-sm"
209+
defaultExpanded={false}
210+
>
211+
<div className="flex items-center space-x-2">
212+
<Checkbox
213+
id="include-audio"
214+
checked={includeAudio}
215+
onCheckedChange={(checked) => setIncludeAudio(!!checked)}
216+
/>
217+
<Label htmlFor="include-audio">
218+
Include audio in export
219+
</Label>
220+
</div>
221+
</PropertyGroup>
200222
</div>
201223

202224
<Button onClick={handleExport} className="w-full gap-2">

0 commit comments

Comments
 (0)