In peer to peer and peer to many peers calls when i disconnect webrtc and RTCVideoRenderer are set to null and also tried disposed.I still see the webrtc logs as
Closing rtcpeerconnection
Future<void> close() async {
// Release the local media stream
if (_localStream != null) {
_localStream!.getTracks().forEach((track) {
track.stop(); // Stop each track
});
await _localStream!.dispose();
_localStream = null;
}
if (_remoteStreams != null) {
_remoteStreams?.forEach((element) async {
element.getTracks().forEach((track) {
track.stop(); // Stop each track
});
await element.dispose();
});
}
// Cancel subscriptions
await hangupSub?.cancel();
await messagesStreamSubscription?.cancel();
repeatSendCallNotification?.cancel();
// Close all peer connections and release their streams
_peerConnections.forEach((key, pc) async {
// Stop all local and remote tracks
pc.getLocalStreams().forEach((stream) async {
stream?.getTracks().forEach((track) async {
await track.stop();
});
});
pc.getRemoteStreams().forEach((stream) async {
stream?.getTracks().forEach((track) async {
await track.stop();
});
});
// Close the peer connection
await pc.close();
});
// Clear the peer connections map
_peerConnections.clear();
}
Describe the bug
In peer to peer and peer to many peers calls when i disconnect webrtc and
RTCVideoRenderer
are set to null and also tried disposed.I still see the webrtc logs asClosing rtcpeerconnection
and
handup call
webrtc logs
To Reproduce
Using latest Version and set a peer to peer call. I am using firebase for signaling.
Expected behavior
All resources for audio and video should be released and there should be no log.
Platform information
flutter doctor v
• Flutter version 3.16.0 on channel stable at /Users/bilalrabbi/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision db7ef5bf9f (8 weeks ago), 2023-11-15 11:25:44 -0800 • Engine revision 74d16627b9 • Dart version 3.2.0 • DevTools version 2.28.2[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/bilalrabbi/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/bilalrabbi/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C65 • CocoaPods version 1.14.2
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.85.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.80.0
[✓] Connected device (5 available) • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 12 (API 32) (emulator) • sdk gphone64 arm64 (mobile) • emulator-5556 • android-arm64 • Android 12 (API 32) (emulator) • iPhone (mobile) • 00008030-001004D80146802E • ios • iOS 17.1.1 21B91 • iPhone 15 Pro (mobile) • EE6B84E8-4092-497E-9033-9F330AC515B4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator) • Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.129
[✓] Network resources • All expected network resources are available.
Plugin version: 0.9.47
OS: Android and iOS
OS version: Android version 12