From 4f4813c40398c9519fe8a7090662c73a428eca3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B0=D0=BB=D0=B8=D0=BC=D0=BE=D0=B2=20=D0=A0=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BC?= Date: Wed, 11 Mar 2026 16:48:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D1=81=D1=82=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/components/CallModal.tsx | 31 ++++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/apps/web/src/components/CallModal.tsx b/apps/web/src/components/CallModal.tsx index dce11c9..3a8f6eb 100644 --- a/apps/web/src/components/CallModal.tsx +++ b/apps/web/src/components/CallModal.tsx @@ -291,15 +291,25 @@ export default function CallModal({ isOpen, onClose, targetUser, callType: initi if (remoteVideoRef.current.srcObject !== stream) { console.log('[WebRTC] Binding stream to video element'); remoteVideoRef.current.srcObject = stream; - remoteVideoRef.current.load(); } - // Important: Unmute for remote audio to work - remoteVideoRef.current.muted = false; + + // Ensure not muted for remote audio + if (remoteVideoRef.current.muted) { + remoteVideoRef.current.muted = false; + } + remoteVideoRef.current.play() - .then(() => setNeedsInteraction(false)) + .then(() => { + console.log('[WebRTC] Playback started successfully'); + setNeedsInteraction(false); + }) .catch(e => { - console.warn('[WebRTC] Play failed, waiting for user interaction:', e); - setNeedsInteraction(true); + if (e.name === 'NotAllowedError' || e.name === 'NotSupportedError') { + console.warn('[WebRTC] Autoplay blocked, waiting for interaction'); + setNeedsInteraction(true); + } else { + console.warn('[WebRTC] Playback failed (non-autoplay error):', e); + } }); } @@ -1621,9 +1631,14 @@ export default function CallModal({ isOpen, onClose, targetUser, callType: initi