swift – WebRTC doesn’t generate ICE candidates for video in incoming video call for iOS


I am developing an app for ios and have integrated WebRTC to make video calls. For outgoing call it’s fine, all works fine. But when I want to receive a video call, while setting a local description, didGenerate delegate doesn’t return me a ICE candidate for video call (candidate.sdpMid property should be 1) it returns me only ICE candidates for audio where candidate.spdMid is 0.

Here is the steps what I am doing:

  1. Upon receiving an incoming video call I am handling remoteSdp (a have all parameters with m=video), creating RTCSessionDescription with Offer
  2. After I am preparing media (adding video tracks to peerConnection)
  3. Setting remote description to peerConnection and in it’s callback I am creating answerForConstraints where OfferToReceiveVideo and OfferToReceiveAudio are true.
  4. in answerForConstraints’s callback I am setting localSdp from callback via setLocalDescription.
  5. Then Webrtc is generating ICE candidates and there is no candidates for video. usually ICE candidate should contain in property candidate.sdpMid = 1 for video, but I am getting candidate.sdpMid = 0 (only for audio).

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img