Skip to content

Commit fcfc566

Browse files
authored
cleanup when remove remote participants. (#460)
1 parent 0f68590 commit fcfc566

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/src/core/room.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
379379

380380
for (final participant in copy) {
381381
events.emit(ParticipantDisconnectedEvent(participant: participant));
382+
await participant.removeAllPublishedTracks(notify: false);
382383
await participant.dispose();
383384
}
384385
notifyListeners();
@@ -730,6 +731,7 @@ extension RoomPrivateMethods on Room {
730731
// clean up RemoteParticipants
731732
var participants = _remoteParticipants.values.toList();
732733
for (final participant in participants) {
734+
await participant.removeAllPublishedTracks(notify: false);
733735
// RemoteParticipant is responsible for disposing resources
734736
await participant.dispose();
735737
}

0 commit comments

Comments
 (0)