Update tgcalls + webrtc + audio session state management

This commit is contained in:
Ali
2022-11-22 19:49:53 +04:00
parent b62aeeb6cc
commit f6c56c2241
5 changed files with 49 additions and 34 deletions

View File

@@ -1575,17 +1575,20 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
self.internalStatePromise.set(.single(internalState))
if let audioSessionControl = audioSessionControl, previousControl == nil {
if self.isStream {
audioSessionControl.setOutputMode(.system)
if "".isEmpty {
} else {
switch self.currentSelectedAudioOutputValue {
case .speaker:
audioSessionControl.setOutputMode(.custom(self.currentSelectedAudioOutputValue))
default:
break
if self.isStream {
audioSessionControl.setOutputMode(.system)
} else {
switch self.currentSelectedAudioOutputValue {
case .speaker:
audioSessionControl.setOutputMode(.custom(self.currentSelectedAudioOutputValue))
default:
break
}
}
audioSessionControl.setup(synchronous: false)
}
audioSessionControl.setup(synchronous: false)
}
self.audioSessionShouldBeActive.set(true)
@@ -2475,6 +2478,9 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
}
private func beginTone(tone: PresentationCallTone) {
if "".isEmpty {
return
}
if self.isStream {
switch tone {
case .groupJoined, .groupLeft: