|
|
|
|
@ -205,7 +205,6 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
print("------------------ PC Stopped ----------------------------");
|
|
|
|
|
_pc.close();
|
|
|
|
|
_pc.dispose();
|
|
|
|
|
_pc.close();
|
|
|
|
|
}
|
|
|
|
|
isCallStarted = false;
|
|
|
|
|
isVideoCall = false;
|
|
|
|
|
@ -217,6 +216,9 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
isIncomingCall = false;
|
|
|
|
|
if (chatHubConnection != null) {
|
|
|
|
|
chatHubConnection.stop();
|
|
|
|
|
await localVideoRenderer.dispose();
|
|
|
|
|
localStream.dispose();
|
|
|
|
|
remoteRenderer.dispose();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
@ -229,7 +231,9 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
if (_pc.connectionState == RTCPeerConnectionState.RTCPeerConnectionStateConnected) {
|
|
|
|
|
_pc.close();
|
|
|
|
|
_pc.dispose();
|
|
|
|
|
_pc.close();
|
|
|
|
|
localStream.dispose();
|
|
|
|
|
remoteRenderer.dispose();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
isCallStarted = false;
|
|
|
|
|
isVideoCall = false;
|
|
|
|
|
@ -237,6 +241,7 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
isMicOff = false;
|
|
|
|
|
isLoudSpeaker = false;
|
|
|
|
|
localVideoRenderer.srcObject = null;
|
|
|
|
|
await localVideoRenderer.dispose();
|
|
|
|
|
remoteRenderer.srcObject = null;
|
|
|
|
|
isOutGoingCall = false;
|
|
|
|
|
return true;
|
|
|
|
|
@ -273,7 +278,7 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
// isEndedByCaller = true;
|
|
|
|
|
endCall().then((bool value) {
|
|
|
|
|
Navigator.of(AppRoutes.navigatorKey.currentContext!).pop();
|
|
|
|
|
notifyListeners();
|
|
|
|
|
// notifyListeners();
|
|
|
|
|
isCallEnded = true;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|