mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Stories
This commit is contained in:
parent
6b330351e1
commit
99430812c1
6 changed files with 71 additions and 60 deletions
|
|
@ -951,8 +951,8 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||
|
||||
var sharedAudioContext = sharedAudioContext
|
||||
if sharedAudioContext == nil {
|
||||
var useSharedAudio = !isStream
|
||||
var canReuseCurrent = true
|
||||
var useSharedAudio = true
|
||||
var canReuseCurrent = !isStream
|
||||
if let data = self.accountContext.currentAppConfiguration.with({ $0 }).data {
|
||||
if data["ios_killswitch_group_shared_audio"] != nil {
|
||||
useSharedAudio = false
|
||||
|
|
@ -962,8 +962,12 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||
}
|
||||
}
|
||||
|
||||
if isStream {
|
||||
useSharedAudio = false
|
||||
}
|
||||
|
||||
if useSharedAudio {
|
||||
let sharedAudioContextValue = SharedCallAudioContext.get(audioSession: audioSession, callKitIntegration: callKitIntegration, defaultToSpeaker: true, reuseCurrent: canReuseCurrent && callKitIntegration == nil)
|
||||
let sharedAudioContextValue = SharedCallAudioContext.get(audioSession: audioSession, callKitIntegration: callKitIntegration, defaultToSpeaker: true, reuseCurrent: canReuseCurrent && callKitIntegration == nil, enableMicrophone: !isStream)
|
||||
sharedAudioContext = sharedAudioContextValue
|
||||
}
|
||||
}
|
||||
|
|
@ -2077,6 +2081,8 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||
}
|
||||
|
||||
if let genericCallContext = self.genericCallContext {
|
||||
let callInfo = joinCallResult.callInfo
|
||||
|
||||
switch genericCallContext {
|
||||
case let .call(callContext):
|
||||
switch joinCallResult.connectionMode {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue