mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
e0f4655cc5
871 changed files with 275897 additions and 64193 deletions
|
|
@ -176,6 +176,7 @@ final class CallControllerNodeV2: ViewControllerTracingNode, CallControllerNodeP
|
|||
shortName: " ",
|
||||
avatarImage: nil,
|
||||
audioOutput: .internalSpeaker,
|
||||
canSwitchAudioOutput: true,
|
||||
isLocalAudioMuted: false,
|
||||
isRemoteAudioMuted: false,
|
||||
localVideo: nil,
|
||||
|
|
@ -271,6 +272,11 @@ final class CallControllerNodeV2: ViewControllerTracingNode, CallControllerNodeP
|
|||
self.currentAudioOutput = currentOutput
|
||||
|
||||
if var callScreenState = self.callScreenState {
|
||||
var canSwitchAudioOutput = false
|
||||
if availableOutputs.count > 1 {
|
||||
canSwitchAudioOutput = true
|
||||
}
|
||||
|
||||
let mappedOutput: PrivateCallScreen.State.AudioOutput
|
||||
if let currentOutput {
|
||||
switch currentOutput {
|
||||
|
|
@ -301,8 +307,9 @@ final class CallControllerNodeV2: ViewControllerTracingNode, CallControllerNodeP
|
|||
mappedOutput = .internalSpeaker
|
||||
}
|
||||
|
||||
if callScreenState.audioOutput != mappedOutput {
|
||||
if callScreenState.audioOutput != mappedOutput || callScreenState.canSwitchAudioOutput != canSwitchAudioOutput {
|
||||
callScreenState.audioOutput = mappedOutput
|
||||
callScreenState.canSwitchAudioOutput = canSwitchAudioOutput
|
||||
self.callScreenState = callScreenState
|
||||
self.update(transition: .animated(duration: 0.3, curve: .spring))
|
||||
|
||||
|
|
|
|||
|
|
@ -156,11 +156,11 @@ final class VideoChatActionButtonComponent: Component {
|
|||
switch component.content {
|
||||
case let .audio(audio, isEnabledValue):
|
||||
var isActive = false
|
||||
isEnabled = isEnabledValue
|
||||
switch audio {
|
||||
case .none, .builtin:
|
||||
titleText = component.strings.Call_Speaker
|
||||
case .speaker:
|
||||
isEnabled = isEnabledValue
|
||||
isActive = isEnabledValue
|
||||
titleText = component.strings.Call_Speaker
|
||||
case .headphones:
|
||||
|
|
@ -324,7 +324,7 @@ final class VideoChatActionButtonComponent: Component {
|
|||
}
|
||||
transition.setPosition(view: iconView, position: iconFrame.center)
|
||||
transition.setBounds(view: iconView, bounds: CGRect(origin: CGPoint(), size: iconFrame.size))
|
||||
transition.setAlpha(view: iconView, alpha: isEnabled ? 1.0 : 0.6)
|
||||
transition.setAlpha(view: iconView, alpha: isEnabled ? 1.0 : 0.4)
|
||||
transition.setScale(view: iconView, scale: availableSize.height / 56.0)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2619,6 +2619,7 @@ final class VideoChatScreenComponent: Component {
|
|||
|
||||
let videoButtonContent: VideoChatActionButtonComponent.Content?
|
||||
let videoControlButtonContent: VideoChatActionButtonComponent.Content
|
||||
let videoControlButtonEnabled: Bool
|
||||
let messageButtonContent: VideoChatActionButtonComponent.Content?
|
||||
|
||||
var buttonAudio: VideoChatActionButtonComponent.Content.Audio = .speaker
|
||||
|
|
@ -2652,13 +2653,16 @@ final class VideoChatScreenComponent: Component {
|
|||
if let callState = self.callState, let muteState = callState.muteState, !muteState.canUnmute {
|
||||
videoButtonContent = nil
|
||||
videoControlButtonContent = .audio(audio: buttonAudio, isEnabled: buttonIsEnabled)
|
||||
videoControlButtonEnabled = buttonIsEnabled
|
||||
} else {
|
||||
let isVideoActive = self.callState?.isMyVideoActive ?? false
|
||||
videoButtonContent = .video(isActive: isVideoActive)
|
||||
if isVideoActive {
|
||||
videoControlButtonContent = .rotateCamera
|
||||
videoControlButtonEnabled = true
|
||||
} else {
|
||||
videoControlButtonContent = .audio(audio: buttonAudio, isEnabled: buttonIsEnabled)
|
||||
videoControlButtonEnabled = buttonIsEnabled
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3225,7 +3229,7 @@ final class VideoChatScreenComponent: Component {
|
|||
transition.setPosition(view: microphoneButtonView, position: microphoneButtonFrame.center)
|
||||
transition.setBounds(view: microphoneButtonView, bounds: CGRect(origin: CGPoint(), size: microphoneButtonFrame.size))
|
||||
}
|
||||
|
||||
|
||||
let _ = self.speakerButton.update(
|
||||
transition: transition,
|
||||
component: AnyComponent(PlainButtonComponent(
|
||||
|
|
@ -3248,6 +3252,7 @@ final class VideoChatScreenComponent: Component {
|
|||
self.onAudioRoutePressed()
|
||||
}
|
||||
},
|
||||
isEnabled: videoControlButtonEnabled,
|
||||
animateAlpha: false
|
||||
)),
|
||||
environment: {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue