mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-21 07:21:17 -04:00
clean up <Video />
props
This commit is contained in:
@@ -5,22 +5,25 @@ import type { FilePlayerProps } from "react-player/file";
|
||||
import styles from "./Video.module.css";
|
||||
|
||||
export type VideoProps = Partial<FilePlayerProps> & {
|
||||
webm?: string;
|
||||
mp4?: string;
|
||||
src: {
|
||||
// at least one is required:
|
||||
webm?: string;
|
||||
mp4?: string;
|
||||
};
|
||||
thumbnail?: string;
|
||||
subs?: string;
|
||||
autoplay?: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Video = ({ webm, mp4, thumbnail, subs, autoplay, className, ...rest }: VideoProps) => {
|
||||
const Video = ({ src, thumbnail, subs, autoplay, className, ...rest }: VideoProps) => {
|
||||
const url = [
|
||||
webm && {
|
||||
src: webm,
|
||||
src.webm && {
|
||||
src: src.webm,
|
||||
type: "video/webm",
|
||||
},
|
||||
mp4 && {
|
||||
src: mp4,
|
||||
src.mp4 && {
|
||||
src: src.mp4,
|
||||
type: "video/mp4",
|
||||
},
|
||||
];
|
||||
|
Reference in New Issue
Block a user