mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-18 21:49:31 +02:00
fix: add mkv to supported videos
This commit is contained in:
@@ -5,11 +5,12 @@ import 'rc-slider/assets/index.css';
|
||||
import BaseFileInput from './BaseFileInput';
|
||||
import { BaseFileInputProps, formatTime } from './file-input-utils';
|
||||
|
||||
interface VideoFileInputProps extends BaseFileInputProps {
|
||||
interface VideoFileInputProps extends Omit<BaseFileInputProps, 'accept'> {
|
||||
showTrimControls?: boolean;
|
||||
onTrimChange?: (trimStart: number, trimEnd: number) => void;
|
||||
trimStart?: number;
|
||||
trimEnd?: number;
|
||||
accept?: string[];
|
||||
}
|
||||
|
||||
export default function ToolVideoInput({
|
||||
@@ -17,6 +18,7 @@ export default function ToolVideoInput({
|
||||
onTrimChange,
|
||||
trimStart = 0,
|
||||
trimEnd = 100,
|
||||
accept = ['video/*', '.mkv'],
|
||||
...props
|
||||
}: VideoFileInputProps) {
|
||||
const videoRef = useRef<HTMLVideoElement>(null);
|
||||
@@ -38,7 +40,7 @@ export default function ToolVideoInput({
|
||||
};
|
||||
|
||||
return (
|
||||
<BaseFileInput {...props} type={'video'}>
|
||||
<BaseFileInput {...props} type={'video'} accept={accept}>
|
||||
{({ preview }) => (
|
||||
<Box
|
||||
sx={{
|
||||
|
@@ -160,7 +160,6 @@ export default function CompressVideo({ title }: ToolComponentProps) {
|
||||
<ToolVideoInput
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
accept={['video/mp4', 'video/webm', 'video/ogg']}
|
||||
title={'Input Video'}
|
||||
/>
|
||||
}
|
||||
|
@@ -61,13 +61,7 @@ export default function Loop({ title, longDescription }: ToolComponentProps) {
|
||||
<ToolContent
|
||||
title={title}
|
||||
input={input}
|
||||
inputComponent={
|
||||
<ToolVideoInput
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
accept={['video/*']}
|
||||
/>
|
||||
}
|
||||
inputComponent={<ToolVideoInput value={input} onChange={setInput} />}
|
||||
resultComponent={
|
||||
loading ? (
|
||||
<ToolFileResult
|
||||
|
@@ -81,7 +81,6 @@ export default function RotateVideo({ title }: ToolComponentProps) {
|
||||
<ToolVideoInput
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
accept={['video/mp4', 'video/webm', 'video/ogg']}
|
||||
title={'Input Video'}
|
||||
/>
|
||||
}
|
||||
|
@@ -116,7 +116,6 @@ export default function TrimVideo({ title }: ToolComponentProps) {
|
||||
<ToolVideoInput
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
accept={['video/mp4', 'video/webm', 'video/ogg']}
|
||||
title={'Input Video'}
|
||||
showTrimControls={true}
|
||||
onTrimChange={(trimStart, trimEnd) => {
|
||||
|
Reference in New Issue
Block a user