- Added package.json with dependencies and scripts for development, build, and linting. - Created postcss.config.mjs for Tailwind CSS integration. - Added SVG assets for UI components including file, globe, next, vercel, and window icons. - Configured TypeScript with tsconfig.json for strict type checking and module resolution.
30 lines
637 B
TypeScript
30 lines
637 B
TypeScript
import { forwardRef } from "react";
|
|
|
|
interface VideoPlayerProps {
|
|
src?: string;
|
|
poster?: string;
|
|
className?: string;
|
|
}
|
|
|
|
const VideoPlayer = forwardRef<HTMLVideoElement, VideoPlayerProps>(
|
|
({ src, poster, className }, ref) => {
|
|
return (
|
|
<div className={`relative h-full w-full bg-black ${className ?? ""}`}>
|
|
<video
|
|
ref={ref}
|
|
src={src}
|
|
poster={poster}
|
|
autoPlay
|
|
playsInline
|
|
className="h-full w-full object-contain"
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
);
|
|
|
|
VideoPlayer.displayName = "VideoPlayer";
|
|
|
|
export { VideoPlayer };
|
|
export type { VideoPlayerProps };
|