forked from mirrors/linphone-iphone
Fix meeting waiting room when headphone is connected
This commit is contained in:
parent
b523315e82
commit
e4c64cc4af
2 changed files with 17 additions and 7 deletions
|
|
@ -52,7 +52,9 @@ struct MeetingWaitingRoomFragment: View {
|
|||
})
|
||||
.onAppear {
|
||||
meetingWaitingRoomViewModel.enableAVAudioSession()
|
||||
if AVAudioSession.sharedInstance().currentRoute.outputs.filter({ $0.portType.rawValue.contains("Bluetooth") }).isEmpty {
|
||||
if AVAudioSession.sharedInstance().currentRoute.outputs.filter({
|
||||
$0.portType.rawValue.contains("Bluetooth") || $0.portType.rawValue.contains("Headphones")
|
||||
}).isEmpty {
|
||||
do {
|
||||
try AVAudioSession.sharedInstance().overrideOutputAudioPort(.speaker)
|
||||
} catch _ {
|
||||
|
|
@ -72,8 +74,9 @@ struct MeetingWaitingRoomFragment: View {
|
|||
}
|
||||
.onAppear {
|
||||
meetingWaitingRoomViewModel.enableAVAudioSession()
|
||||
|
||||
if AVAudioSession.sharedInstance().currentRoute.outputs.filter({ $0.portType.rawValue.contains("Bluetooth") }).isEmpty {
|
||||
if AVAudioSession.sharedInstance().currentRoute.outputs.filter({
|
||||
$0.portType.rawValue.contains("Bluetooth") || $0.portType.rawValue.contains("Headphones")
|
||||
}).isEmpty {
|
||||
do {
|
||||
try AVAudioSession.sharedInstance().overrideOutputAudioPort(.speaker)
|
||||
} catch _ {
|
||||
|
|
|
|||
|
|
@ -50,6 +50,11 @@ class MeetingWaitingRoomViewModel: ObservableObject {
|
|||
|
||||
func resetMeetingRoomView() {
|
||||
if self.telecomManager.meetingWaitingRoomSelected != nil {
|
||||
do {
|
||||
try AVAudioSession.sharedInstance().setCategory(.playAndRecord, mode: .voiceChat, options: .allowBluetooth)
|
||||
} catch _ {
|
||||
|
||||
}
|
||||
coreContext.doOnCoreQueue { core in
|
||||
|
||||
let conf = core.findConferenceInformationFromUri(uri: self.telecomManager.meetingWaitingRoomSelected!)
|
||||
|
|
@ -73,12 +78,14 @@ class MeetingWaitingRoomViewModel: ObservableObject {
|
|||
if friend != nil && friend!.address != nil && friend!.address!.displayName != nil {
|
||||
userNameTmp = friend!.address!.displayName!
|
||||
} else {
|
||||
if core.defaultAccount != nil && core.defaultAccount!.contactAddress != nil {
|
||||
if core.defaultAccount!.contactAddress!.displayName != nil {
|
||||
userNameTmp = core.defaultAccount!.contactAddress!.displayName!
|
||||
} else if core.defaultAccount!.contactAddress!.username != nil {
|
||||
userNameTmp = core.defaultAccount!.contactAddress!.username!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let avatarModelTmp = friend != nil
|
||||
? ContactsManager.shared.avatarListModel.first(where: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue