From e36c3aaed786d2d45a5c3ea804a29b5d2bd48c12 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 4 May 2017 13:14:07 -0400 Subject: [PATCH] Reconcile audio and video enabling with call state. // FREEBIE --- Signal/src/call/CallService.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Signal/src/call/CallService.swift b/Signal/src/call/CallService.swift index 5d400b784..783ed87ab 100644 --- a/Signal/src/call/CallService.swift +++ b/Signal/src/call/CallService.swift @@ -911,7 +911,9 @@ protocol CallServiceObserver: class { return } - peerConnectionClient.setAudioEnabled(enabled: !isMuted) + if call.state == .connected { + peerConnectionClient.setAudioEnabled(enabled: !isMuted) + } } /** @@ -966,7 +968,9 @@ protocol CallServiceObserver: class { return } - peerConnectionClient.setLocalVideoEnabled(enabled: shouldHaveLocalVideoTrack()) + if call.state == .connected { + peerConnectionClient.setLocalVideoEnabled(enabled: shouldHaveLocalVideoTrack()) + } } func handleCallKitStartVideo() {