diff --git a/client/src/components/video-card.tsx b/client/src/components/video-card.tsx index e1922b5..b846489 100644 --- a/client/src/components/video-card.tsx +++ b/client/src/components/video-card.tsx @@ -1,4 +1,4 @@ -import { Play } from "lucide-react"; +import { Play, Volume2, VolumeX } from "lucide-react"; import { type Video } from "@shared/schema"; import { useState, useRef, useEffect } from "react"; import Hls from "hls.js"; @@ -46,6 +46,7 @@ function formatDate(date: Date | string): string { export default function VideoCard({ video, onClick, className = "", hideOverlay = false }: VideoCardProps) { const [isHovered, setIsHovered] = useState(false); const [showPreview, setShowPreview] = useState(false); + const [isMuted, setIsMuted] = useState(true); const hoverTimeoutRef = useRef(); const videoRef = useRef(null); const hlsRef = useRef(null); @@ -171,7 +172,7 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay objectFit: 'cover' }} autoPlay - muted={window.innerWidth >= 768 ? false : true} + muted={isMuted} loop playsInline controls={false} @@ -192,6 +193,26 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay }} /> + {/* Mute/Unmute button */} + + {/* Video scrubbing progress bar - only show during preview */} {duration > 0 && (