This commit is contained in:
root 2025-07-11 17:53:48 +08:00
parent e34d2dd5e3
commit e3eb009e82
1 changed files with 4 additions and 1 deletions

View File

@ -69,7 +69,10 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
useEffect(() => { useEffect(() => {
const video = videoRef.current const video = videoRef.current
if (!video) return if (!video) return
const source = document.createElement('source');
source.type = 'video/mp4';
source.src = videoSrc;
video.appendChild(source);
const handleTimeUpdate = () => setCurrentTime(video.currentTime) const handleTimeUpdate = () => setCurrentTime(video.currentTime)
const handleDurationChange = () => setDuration(video.duration) const handleDurationChange = () => setDuration(video.duration)
const handleEnded = () => setIsPlaying(false) const handleEnded = () => setIsPlaying(false)