diff options
| author | Aashish Paruvada <79566248+aashishparuvada@users.noreply.github.com> | 2025-06-23 21:06:33 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-23 21:06:33 +0530 |
| commit | 4c8a37c63555b9ea608628a5895f9918fd698871 (patch) | |
| tree | 28e219f06c3b2b7c8c4b596c6c4bddf059992d15 /apps/web/src/components/editor/speed-control.tsx | |
| parent | 630250c23b1cd8ec608c95334ae2babf8e7a00af (diff) | |
| parent | 13817a5ff847762a3ac4eb7cb09d17012b59e520 (diff) | |
| download | opencut-4c8a37c63555b9ea608628a5895f9918fd698871.tar.gz | |
Merge branch 'OpenCut-app:main' into main
Diffstat (limited to 'apps/web/src/components/editor/speed-control.tsx')
| -rw-r--r-- | apps/web/src/components/editor/speed-control.tsx | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/apps/web/src/components/editor/speed-control.tsx b/apps/web/src/components/editor/speed-control.tsx new file mode 100644 index 00000000..39281a9a --- /dev/null +++ b/apps/web/src/components/editor/speed-control.tsx @@ -0,0 +1,46 @@ +import { Slider } from "../ui/slider"; +import { Label } from "../ui/label"; +import { Button } from "../ui/button"; +import { usePlaybackStore } from "@/stores/playback-store"; + +const SPEED_PRESETS = [ + { label: "0.5x", value: 0.5 }, + { label: "1x", value: 1.0 }, + { label: "1.5x", value: 1.5 }, + { label: "2x", value: 2.0 }, +]; + +export function SpeedControl() { + const { speed, setSpeed } = usePlaybackStore(); + + return ( + <div className="space-y-4"> + <h3 className="text-sm font-medium">Playback Speed</h3> + <div className="space-y-4"> + <div className="flex gap-2"> + {SPEED_PRESETS.map((preset) => ( + <Button + key={preset.value} + variant={speed === preset.value ? "default" : "outline"} + className="flex-1" + onClick={() => setSpeed(preset.value)} + > + {preset.label} + </Button> + ))} + </div> + <div className="space-y-1"> + <Label>Custom ({speed.toFixed(1)}x)</Label> + <Slider + value={[speed]} + min={0.1} + max={2.0} + step={0.1} + onValueChange={(value) => setSpeed(value[0])} + className="mt-2" + /> + </div> + </div> + </div> + ); +}
\ No newline at end of file |
