From 38c37ec168e502cbe249916cdae1fc813db7fb85 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Thu, 25 Aug 2022 10:35:50 +0800 Subject: [PATCH] fix: Fixed issue with group calls for web and flutter. --- lib/src/voip/call.dart | 2 +- lib/src/voip/group_call.dart | 11 ++++------- pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/src/voip/call.dart b/lib/src/voip/call.dart index b45b0ed8..a71d37d0 100644 --- a/lib/src/voip/call.dart +++ b/lib/src/voip/call.dart @@ -82,7 +82,7 @@ class WrappedMediaStream { Future dispose() async { renderer.srcObject = null; - if (isLocal() && stream != null) { + if (isLocal() && stream != null && isWeb) { for (final element in stream!.getTracks()) { await element.stop(); } diff --git a/lib/src/voip/group_call.dart b/lib/src/voip/group_call.dart index e6667d06..d5852884 100644 --- a/lib/src/voip/group_call.dart +++ b/lib/src/voip/group_call.dart @@ -1092,13 +1092,10 @@ class GroupCall { onStreamRemoved.add(stream); - if (voip.delegate.isWeb) { - stream.stream!.getTracks().forEach((element) { - element.stop(); - }); - } - - stream.dispose(); + stream.stream!.getTracks().forEach((element) { + element.stop(); + }); + stream.stream!.dispose(); onGroupCallEvent.add(GroupCallEvent.UserMediaStreamsChanged); diff --git a/pubspec.yaml b/pubspec.yaml index cbd43b6b..f300be8a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -29,7 +29,7 @@ dependencies: random_string: ^2.3.1 sdp_transform: ^0.3.2 slugify: ^2.0.0 - webrtc_interface: ^1.0.1 + webrtc_interface: ^1.0.7 dev_dependencies: coverage: ">=0.15.0 <2.0.0"