forked from mirrors/linphone-iphone
fix change route audio
This commit is contained in:
parent
df15b6cd27
commit
b48704b59d
1 changed files with 2 additions and 2 deletions
|
|
@ -129,7 +129,7 @@ import AVFoundation
|
|||
let newRoute = AVAudioSession.sharedInstance().currentRoute
|
||||
if (newRoute.outputs.count > 0) {
|
||||
let route = newRoute.outputs[0].portType
|
||||
allow = route != .lineOut || route == .headphones || (AudioHelper.bluetoothRoutes() as Array).contains(where: {($0 as! AVAudioSession.Port) == route})
|
||||
allow = !( route == .lineOut || route == .headphones || (AudioHelper.bluetoothRoutes() as Array).contains(where: {($0 as! AVAudioSession.Port) == route}))
|
||||
}
|
||||
|
||||
return allow
|
||||
|
|
@ -144,7 +144,7 @@ import AVFoundation
|
|||
bluetoothEnabled = false
|
||||
} else {
|
||||
try AVAudioSession.sharedInstance().overrideOutputAudioPort(.none)
|
||||
let buildinPort = AudioHelper.bluetoothAudioDevice()
|
||||
let buildinPort = AudioHelper.builtinAudioDevice()
|
||||
try AVAudioSession.sharedInstance().setPreferredInput(buildinPort)
|
||||
UIDevice.current.isProximityMonitoringEnabled = (lc!.callsNb > 0)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue