[iOS] No audio when i connect webrtc. just video works
hieplee2997 opened this issue · 2 comments
hieplee2997 commented
I use this plugin with flutter-webrtc plugin. after i receive PUSHKIT and perform answer, i will perform renegotiation webrtc connection. Webrtc connection works fine with video, but without audio. I see the CallKeepDidActivateAudioSession event always fire before i add stream to webrtc. I don't have no idea in this issue. What wrong i does? Thanks
if i change AVAudioSession category AVAudioSessionCategoryPlayback instead of AVAudioSessionCategoryPlayAndRecord in configureAudioSession, it works.
I dont know why?
viplifes commented
Same problem here flutter-webrtc/flutter-webrtc#816
SNNafi commented
Try this
let session = AVAudioSession.sharedInstance()
do {
try session.setCategory(.playAndRecord, mode: hasVideo ? .videoChat : .voiceChat, options: [])
} catch (let error) {
print("Error while configuring audio session: \(error)")
}