mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Stories
This commit is contained in:
@@ -37,18 +37,18 @@ public final class SharedCallAudioContext {
|
||||
|
||||
private var proximityManagerIndex: Int?
|
||||
|
||||
static func get(audioSession: ManagedAudioSession, callKitIntegration: CallKitIntegration?, defaultToSpeaker: Bool = false, reuseCurrent: Bool = false) -> SharedCallAudioContext {
|
||||
static func get(audioSession: ManagedAudioSession, callKitIntegration: CallKitIntegration?, defaultToSpeaker: Bool = false, reuseCurrent: Bool = false, enableMicrophone: Bool = true) -> SharedCallAudioContext {
|
||||
if let current = self.current, reuseCurrent {
|
||||
return current
|
||||
}
|
||||
let context = SharedCallAudioContext(audioSession: audioSession, callKitIntegration: callKitIntegration, defaultToSpeaker: defaultToSpeaker)
|
||||
let context = SharedCallAudioContext(audioSession: audioSession, callKitIntegration: callKitIntegration, defaultToSpeaker: defaultToSpeaker, enableMicrophone: enableMicrophone)
|
||||
self.current = context
|
||||
return context
|
||||
}
|
||||
|
||||
private init(audioSession: ManagedAudioSession, callKitIntegration: CallKitIntegration?, defaultToSpeaker: Bool = false) {
|
||||
private init(audioSession: ManagedAudioSession, callKitIntegration: CallKitIntegration?, defaultToSpeaker: Bool = false, enableMicrophone: Bool = true) {
|
||||
self.callKitIntegration = callKitIntegration
|
||||
self.audioDevice = OngoingCallContext.AudioDevice.create(enableSystemMute: false)
|
||||
self.audioDevice = OngoingCallContext.AudioDevice.create(enableSystemMute: false, enableMicrophone: enableMicrophone)
|
||||
|
||||
var defaultToSpeaker = defaultToSpeaker
|
||||
if audioSession.getIsHeadsetPluggedIn() {
|
||||
@@ -63,7 +63,7 @@ public final class SharedCallAudioContext {
|
||||
}
|
||||
|
||||
var didReceiveAudioOutputs = false
|
||||
self.audioSessionDisposable = audioSession.push(audioSessionType: .voiceCall, manualActivate: { [weak self] control in
|
||||
self.audioSessionDisposable = audioSession.push(audioSessionType: enableMicrophone ? .voiceCall : .play(mixWithOthers: true), manualActivate: { [weak self] control in
|
||||
Queue.mainQueue().async {
|
||||
guard let self else {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user