简体   繁体   中英

I have a question about webrtc implementation

I have trouble implementation webrtc between androids. I nearly have finished implementation webrtc, but I don't understand situation that the one need to send other device reductant SDP offer.

图片

See above image. I show you my implementation as sequence diagram.

My webrtc implementation must need to send other device (reductant/unnecessary) createOffer.

What did I make a mistake? I want to catch little clue.

In advance, thank you.

You were failing to trickle ICE candidates (send them piecemeal to the other peer).

It works the second time because by then, the ICE candidates generated locally so far, have also been stashed in pc.localDescription . So when the peers exchange their updated offer and answer, these contain enough candidates to connect.

Trickle ICE is an optimization, meant to reduce connection time.

I found out it.

    public void onIceCandidateReceived(PeerConnection peer, IceCandidate iceCandidate) {
        peer.addIceCandidate(iceCandidate);
...

The above code has a problem. That iceCandidate must send to other peer.

I solved it, however I have a question.

Why did they work on second call?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM