Open hieplee2997 opened 2 years ago
Same problem here https://github.com/flutter-webrtc/flutter-webrtc/issues/816
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)")
}
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![Screen Shot 2022-05-10 at 10 19 37](https://user-images.githubusercontent.com/55306649/167536170-0ca298c0-4ce2-45a0-ad8c-ece97ef42c77.png)
if i change AVAudioSession category AVAudioSessionCategoryPlayback instead of AVAudioSessionCategoryPlayAndRecord in configureAudioSession, it works. I dont know why?