🐛 Bug fixes of webrtc
This commit is contained in:
@@ -55,7 +55,7 @@ class WebRTCManager {
|
||||
try {
|
||||
_localStream = await navigator.mediaDevices.getUserMedia({
|
||||
'audio': true,
|
||||
'video': false,
|
||||
'video': true,
|
||||
});
|
||||
talker.info('[WebRTC] Local stream initialized');
|
||||
} catch (e) {
|
||||
@@ -263,6 +263,12 @@ class WebRTCManager {
|
||||
track.enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
// Update audio enabled state for all participants (they share the same local stream)
|
||||
for (final participant in _participants.values) {
|
||||
participant.isAudioEnabled = enabled;
|
||||
_participantController.add(participant);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> toggleCamera(bool enabled) async {
|
||||
@@ -271,6 +277,12 @@ class WebRTCManager {
|
||||
track.enabled = enabled;
|
||||
});
|
||||
}
|
||||
|
||||
// Update video enabled state for all participants (they share the same local stream)
|
||||
for (final participant in _participants.values) {
|
||||
participant.isVideoEnabled = enabled;
|
||||
_participantController.add(participant);
|
||||
}
|
||||
}
|
||||
|
||||
List<WebRTCParticipant> get participants => _participants.values.toList();
|
||||
|
||||
Reference in New Issue
Block a user