♻️ Proper local participant
This commit is contained in:
@@ -14,11 +14,13 @@ class WebRTCParticipant {
|
||||
bool isAudioEnabled = true;
|
||||
bool isVideoEnabled = false;
|
||||
bool isConnected = false;
|
||||
bool isLocal = false;
|
||||
|
||||
WebRTCParticipant({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.userinfo,
|
||||
this.isLocal = false,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -271,11 +273,7 @@ class WebRTCManager {
|
||||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
_participants.values.where((e) => e.isLocal).firstOrNull?.isAudioEnabled = true;
|
||||
}
|
||||
|
||||
Future<void> toggleCamera(bool enabled) async {
|
||||
@@ -285,11 +283,7 @@ class WebRTCManager {
|
||||
});
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
_participants.values.where((e) => e.isLocal).firstOrNull?.isVideoEnabled = true;
|
||||
}
|
||||
|
||||
List<WebRTCParticipant> get participants => _participants.values.toList();
|
||||
|
Reference in New Issue
Block a user