From 60c3ca23b3a21dc3bfc5e5701a74cfb293b07c9b Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Thu, 4 Sep 2025 13:07:43 +0000 Subject: [PATCH] Ensure videos start muted by default on the platform Modify the VideoCard component to force muted state on onLoadStart, onPlay, and onCanPlay events for Video.js player. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 946a0075-7e32-454b-b348-9e7f576d7f45 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/60d372ff-2c10-46c7-b01b-10c3435136b0/946a0075-7e32-454b-b348-9e7f576d7f45/JlONw6J --- client/src/components/video-card.tsx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/client/src/components/video-card.tsx b/client/src/components/video-card.tsx index 7d6c217..8f1637c 100644 --- a/client/src/components/video-card.tsx +++ b/client/src/components/video-card.tsx @@ -240,9 +240,28 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay playsInline controls={false} disablePictureInPicture - onLoadStart={() => {}} + onLoadStart={() => { + // Force muted state on load start + if (videoRef.current) { + videoRef.current.muted = isMuted; + videoRef.current.volume = 0; + } + }} onError={() => {}} - onCanPlay={() => {}} + onPlay={() => { + // Force muted state on play + if (videoRef.current) { + videoRef.current.muted = isMuted; + videoRef.current.volume = 0; + } + }} + onCanPlay={() => { + // Force muted state when video can play + if (videoRef.current) { + videoRef.current.muted = isMuted; + videoRef.current.volume = 0; + } + }} onTimeUpdate={(e) => setCurrentTime(e.currentTarget.currentTime)} onLoadedMetadata={(e) => setDuration(e.currentTarget.duration)} onMouseMove={(e) => {