flutter-webrtc/callkeep

[iOS] No audio when i connect webrtc. just video works

hieplee2997 opened this issue · 2 comments

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

if i change AVAudioSession category AVAudioSessionCategoryPlayback instead of AVAudioSessionCategoryPlayAndRecord in configureAudioSession, it works.
I dont know why?

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)")
  }