flutter-webrtc / callkeep

iOS CallKit and Android ConnectionService for Flutter
MIT License
130 stars 139 forks source link

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

Open hieplee2997 opened 2 years ago

hieplee2997 commented 2 years ago

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?

viplifes commented 2 years ago

Same problem here https://github.com/flutter-webrtc/flutter-webrtc/issues/816

SNNafi commented 2 years ago

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