add comments

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent ba97ff3f5f
commit 220cd345f6

@ -89,7 +89,7 @@ class CallViewController: UIViewController, CallObserver, CallServiceObserver, R
// MARK: Audio Source // MARK: Audio Source
var hasAlternateAudioSources: Bool { var hasAlternateAudioSources: Bool {
Logger.info("\(TAG) available audio routes count: \(allAudioSources.count)") Logger.info("\(TAG) available audio sources: \(allAudioSources)")
// internal mic and speakerphone will be the first two, any more than one indicates e.g. an attached bluetooth device. // internal mic and speakerphone will be the first two, any more than one indicates e.g. an attached bluetooth device.
// TODO is this sufficient? Are their devices w/ bluetooth but no external speaker? e.g. ipod? // TODO is this sufficient? Are their devices w/ bluetooth but no external speaker? e.g. ipod?

@ -182,13 +182,18 @@ struct AudioSource: Hashable {
setAudioSession(category: AVAudioSessionCategorySoloAmbient, setAudioSession(category: AVAudioSessionCategorySoloAmbient,
mode: AVAudioSessionModeDefault) mode: AVAudioSessionModeDefault)
} else if call.hasLocalVideo { } else if call.hasLocalVideo {
// Don't allow bluetooth for local video if speakerphone has been explicitly chosen by the user. // Apple Docs say that setting mode to AVAudioSessionModeVideoChat has the
let options: AVAudioSessionCategoryOptions = call.isSpeakerphoneEnabled ? [.defaultToSpeaker] : [.defaultToSpeaker, .allowBluetooth] // side effect of setting options: .allowBluetooth, when I remove the (seemingly unnecessary)
// option, and inspect AVAudioSession.sharedInstance.categoryOptions == 0. And availableInputs
// does not include my linked bluetooth device
setAudioSession(category: AVAudioSessionCategoryPlayAndRecord, setAudioSession(category: AVAudioSessionCategoryPlayAndRecord,
mode: AVAudioSessionModeVideoChat, mode: AVAudioSessionModeVideoChat,
options: options) options: [.allowBluetooth])
} else { } else {
// Apple Docs say that setting mode to AVAudioSessionModeVoiceChat has the
// side effect of setting options: .allowBluetooth, when I remove the (seemingly unnecessary)
// option, and inspect AVAudioSession.sharedInstance.categoryOptions == 0. And availableInputs
// does not include my linked bluetooth device
setAudioSession(category: AVAudioSessionCategoryPlayAndRecord, setAudioSession(category: AVAudioSessionCategoryPlayAndRecord,
mode: AVAudioSessionModeVoiceChat, mode: AVAudioSessionModeVoiceChat,
options: [.allowBluetooth]) options: [.allowBluetooth])

Loading…
Cancel
Save