mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-20 22:49:33 +02:00
Moved setLoading call inside the processVideo fucntion
This commit is contained in:
@@ -25,7 +25,6 @@ export default function ChangeSpeed({
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const compute = (optionsValues: InitialValuesType, input: File | null) => {
|
||||
setLoading(true);
|
||||
if (!input) return;
|
||||
const { newSpeed } = optionsValues;
|
||||
let ffmpeg: FFmpeg | null = null;
|
||||
@@ -35,6 +34,8 @@ export default function ChangeSpeed({
|
||||
file: File,
|
||||
newSpeed: number
|
||||
): Promise<void> => {
|
||||
setLoading(true);
|
||||
|
||||
if (!ffmpeg) {
|
||||
ffmpeg = new FFmpeg();
|
||||
}
|
||||
@@ -124,7 +125,7 @@ export default function ChangeSpeed({
|
||||
};
|
||||
|
||||
// Here we set the output video
|
||||
setResult(main(input, optionsValues));
|
||||
processVideo(input, newSpeed)
|
||||
};
|
||||
|
||||
const getGroups: GetGroupsType<InitialValuesType> | null = ({
|
||||
|
@@ -1,3 +1,3 @@
|
||||
export type InitialValuesType = {
|
||||
newSpeed: Number;
|
||||
newSpeed: number;
|
||||
};
|
||||
|
Reference in New Issue
Block a user