fix: autoplay video

This commit is contained in:
Nevo David 2026-01-19 17:31:14 +07:00
parent c8f6cdb643
commit 99889d59e2
2 changed files with 4 additions and 3 deletions

View File

@ -299,7 +299,7 @@ export const MediaBox: FC<{
children: (
<div className="w-full h-full p-[50px]">
{media.path.indexOf('mp4') > -1 ? (
<VideoFrame url={mediaDirectory.set(media.path)} />
<VideoFrame autoplay={true} url={mediaDirectory.set(media.path)} />
) : (
<img
width="100%"

View File

@ -3,6 +3,7 @@
import { FC } from 'react';
export const VideoFrame: FC<{
url: string;
autoplay?: boolean;
}> = (props) => {
const { url } = props;
return (
@ -10,7 +11,7 @@ export const VideoFrame: FC<{
className="w-full h-full object-cover rounded-[4px]"
src={url + '#t=0.1'}
preload="metadata"
autoPlay={false}
></video>
autoPlay={!!props?.autoplay}
/>
);
};