From 43d767bc0332d2b3fda83ff6e46c154748c4842e Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 19 Oct 2025 18:31:05 +0800 Subject: [PATCH] :bug: Trying to fix something --- lib/pods/chat/call.dart | 5 +++-- lib/pods/chat/webrtc_manager.dart | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/pods/chat/call.dart b/lib/pods/chat/call.dart index f7703587..10992875 100644 --- a/lib/pods/chat/call.dart +++ b/lib/pods/chat/call.dart @@ -94,8 +94,9 @@ class CallNotifier extends _$CallNotifier { // Subscribe to websocket updates return const CallState( isConnected: false, - isMicrophoneEnabled: true, - isCameraEnabled: false, + isMicrophoneEnabled: + true, // Audio enabled by default (matches WebRTC init) + isCameraEnabled: true, // Video enabled by default (matches WebRTC init) isScreenSharing: false, isSpeakerphone: true, ); diff --git a/lib/pods/chat/webrtc_manager.dart b/lib/pods/chat/webrtc_manager.dart index c416a2c0..9dd28d38 100644 --- a/lib/pods/chat/webrtc_manager.dart +++ b/lib/pods/chat/webrtc_manager.dart @@ -167,6 +167,13 @@ class WebRTCManager { if (participant != null) { participant.remoteStream = event.streams[0]; participant.isConnected = true; + + // Detect video tracks and update video enabled state + final videoTracks = event.streams[0].getVideoTracks(); + if (videoTracks.isNotEmpty) { + participant.isVideoEnabled = true; + } + _participantController.add(participant); } }