mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-28 00:29:21 +00:00
Set value when initializing AudioRouteBottomSheet
This commit is contained in:
parent
1ee6ef3150
commit
340db54af1
1 changed files with 10 additions and 11 deletions
|
|
@ -2619,17 +2619,16 @@ struct CallView: View {
|
|||
// swiftlint:enable function_body_length
|
||||
|
||||
func getAudioRouteImage() {
|
||||
imageAudioRoute = AVAudioSession.sharedInstance().currentRoute.outputs.filter({ $0.portType.rawValue == "Speaker" }).isEmpty
|
||||
? (
|
||||
AVAudioSession.sharedInstance().currentRoute.outputs.filter({ $0.portType.rawValue.contains("Bluetooth") }).isEmpty
|
||||
? (
|
||||
callViewModel.isHeadPhoneAvailable()
|
||||
? "headset"
|
||||
: "speaker-slash"
|
||||
)
|
||||
: "bluetooth"
|
||||
)
|
||||
: "speaker-high"
|
||||
if !AVAudioSession.sharedInstance().currentRoute.outputs.filter({ $0.portType.rawValue == "Speaker" }).isEmpty {
|
||||
imageAudioRoute = "speaker-high"
|
||||
optionsAudioRoute = 2
|
||||
} else if !AVAudioSession.sharedInstance().currentRoute.outputs.filter({ $0.portType.rawValue.contains("Bluetooth") }).isEmpty {
|
||||
imageAudioRoute = "bluetooth"
|
||||
optionsAudioRoute = 3
|
||||
} else {
|
||||
imageAudioRoute = callViewModel.isHeadPhoneAvailable() ? "headset" : "speaker-slash"
|
||||
optionsAudioRoute = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue