Commit 9ac6bafa authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

call: ensure audio output

Ensure that audio output for video call is loudspeaker

Change-Id: I86e78e02d03f10238557eca83318e04636b0031a
parent 9e6b56f9
...@@ -334,9 +334,9 @@ class CallViewModel: Stateable, ViewModel { ...@@ -334,9 +334,9 @@ class CallViewModel: Stateable, ViewModel {
} }
func answerCall() -> Completable { func answerCall() -> Completable {
// switch to rcv if that's what we were last using if !self.audioService.isHeadsetConnected.value {
if !self.audioService.isHeadsetConnected.value && !self.audioService.isOutputToSpeaker.value { isAudioOnly ?
self.audioService.overrideToReceiver() self.audioService.overrideToReceiver() : self.audioService.overrideToSpeaker()
} }
return self.callService.accept(call: call) return self.callService.accept(call: call)
} }
...@@ -346,9 +346,9 @@ class CallViewModel: Stateable, ViewModel { ...@@ -346,9 +346,9 @@ class CallViewModel: Stateable, ViewModel {
guard let account = self.accountService.currentAccount else { guard let account = self.accountService.currentAccount else {
return return
} }
// switch to rcv if audio only and no headset connected if !self.audioService.isHeadsetConnected.value {
if isAudioOnly && !self.audioService.isHeadsetConnected.value { isAudioOnly ?
self.audioService.overrideToReceiver() self.audioService.overrideToReceiver() : self.audioService.overrideToSpeaker()
} }
self.callService.placeCall(withAccount: account, self.callService.placeCall(withAccount: account,
toRingId: uri, toRingId: uri,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment