import React, { useRef, useState, useEffect } from 'react'; import { Play, Pause, RefreshCw, Volume2, VolumeX, Maximize } from 'lucide-react'; interface VideoPlayerProps { src: string; } export default function VideoPlayer({ src }: VideoPlayerProps) { const [isPlaying, setIsPlaying] = useState(false); const [progress, setProgress] = useState(0); const [isMuted, setIsMuted] = useState(false); const videoRef = useRef(null); useEffect(() => { setIsPlaying(false); setProgress(0); }, [src]); const togglePlay = () => { if (!videoRef.current) return; if (isPlaying) { videoRef.current.pause(); } else { videoRef.current.play(); } setIsPlaying(!isPlaying); }; const handleTimeUpdate = () => { if (!videoRef.current) return; const percentage = (videoRef.current.currentTime / videoRef.current.duration) * 100; setProgress(percentage); }; const toggleMute = () => { if (!videoRef.current) return; videoRef.current.muted = !isMuted; setIsMuted(!isMuted); }; const handleFullscreen = () => { if (!videoRef.current) return; if (videoRef.current.requestFullscreen) { videoRef.current.requestFullscreen(); } }; return (