Skip to content
Snippets Groups Projects
Commit 0c4a367b authored by Jose Manuel Serrano Amaut's avatar Jose Manuel Serrano Amaut
Browse files

[FEAT]: Refactor prop in VideoPreview from videoSource to just src and allow...

[FEAT]: Refactor prop in VideoPreview from videoSource to just src and allow that propto be a File or string
parent 14b9019a
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,12 @@ import { VideoPreviewProps } from "./VideoPreviewProps";
const VideoPreview: React.FC<VideoPreviewProps> = (
props: VideoPreviewProps
) => {
const { videoSrc, /* autoPlay, controls, */style, className, ...others } = props;
const {
src: videoSrc,
/* autoPlay, controls, */ style,
className,
...others
} = props;
const videoRef = React.useRef<HTMLVideoElement>(null);
......
......@@ -6,22 +6,20 @@ export interface VideoPreviewPropsMap extends OverridableComponentProps {
* video source in string format or File object
* FileItemComponent returns this value in onWatch handler
*/
videoSrc?: File | string;
src?: File | string;
}
type DefVideoProps = React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
type DefVideoProps = React.HTMLProps<HTMLVideoElement>;
type VideoPropsOmitVideoPreviewPropsMap = Omit<DefVideoProps, keyof VideoPreviewPropsMap>;
export type VideoPreviewProps =
export type VideoPreviewProps = VideoPropsOmitVideoPreviewPropsMap &
{
[F in keyof VideoPreviewPropsMap]:
VideoPreviewPropsMap[F]
}
&
{ [K in keyof DefVideoProps]:
DefVideoProps[K]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment