fix: misc

This commit is contained in:
Ibrahima G. Coulibaly
2025-05-23 20:18:04 +01:00
parent 4eacb71938
commit 9593ee516b
3 changed files with 6 additions and 15 deletions

View File

@@ -41,7 +41,7 @@ export default function BaseFileInput({
} catch (error) {
console.error('Error previewing file:', error);
}
}
} else setPreview(null);
}, [value]);
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
@@ -67,11 +67,6 @@ export default function BaseFileInput({
}
};
function handleClear() {
// @ts-ignore
onChange(null);
}
const handleDrop = (event: React.DragEvent<HTMLDivElement>) => {
event.preventDefault();
event.stopPropagation();
@@ -213,11 +208,7 @@ export default function BaseFileInput({
</Box>
)}
</Box>
<InputFooter
handleCopy={handleCopy}
handleImport={handleImportClick}
handleClear={handleClear}
/>
<InputFooter handleCopy={handleCopy} handleImport={handleImportClick} />
<input
ref={fileInputRef}
style={{ display: 'none' }}

View File

@@ -1,4 +1,3 @@
/* eslint-disable prettier/prettier */
import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolContent from '@components/ToolContent';
@@ -23,14 +22,14 @@ export default function ChangeSpeed({
const [result, setResult] = useState<File | null>(null);
const [loading, setLoading] = useState(false);
// FFmpeg only supports atempo between 0.5 and 2.0, so we chain filters
// FFmpeg only supports a tempo between 0.5 and 2.0, so we chain filters
const computeAudioFilter = (speed: number): string => {
if (speed <= 2 && speed >= 0.5) {
return `atempo=${speed}`;
}
// Break into supported chunks
const filters = [];
const filters: string[] = [];
let remainingSpeed = speed;
while (remainingSpeed > 2.0) {
filters.push('atempo=2.0');
@@ -55,6 +54,7 @@ export default function ChangeSpeed({
file: File,
newSpeed: number
): Promise<void> => {
if (newSpeed === 0) return;
setLoading(true);
if (!ffmpeg) {

View File

@@ -7,7 +7,7 @@ export const tool = defineTool('video', {
icon: 'material-symbols-light:speed-outline',
description:
'This online utility lets you change the speed of a video. You can speed it up or slow it down.',
shortDescription: 'Quickly change VIDEO speed',
shortDescription: 'Quickly change video speed',
keywords: ['change', 'speed'],
component: lazy(() => import('./index'))
});