RTCMultiConnection Docs

RTCMultiConnection API Reference / "renegotiation"

  1. Renegotiation is a process allows you modify pre-created peer connections when you want to:
    1. append additional streams
    2. remove existing streams
    3. modify SDP for peers direction or something else
  2. Renegotiation means re-exchanging offer/answer SDP among peers.
  3. Renegotiation means you want to use same peer-connections to append dynamic streams at runtime.
  4. "addStream" method appends media stream in all peer connections:
  5. // runtime sharing of audio/video among all users
    connection.addStream({
        audio: true,
        video: true
    });
    
  6. You can renegotiate data-connection in your existing audio/video/screen session!
    connection.addStream({
        data: true
    });
    
  7. You can use "peers" object to append between two unique users:
  8. // runtime sharing of screen among two unique users
    // one is you; and other is person whose id is given below
    connection.peers['user-id'].addStream({
        screen: true,
        oneway: true
    });
    
  9. Remember, renegotiation means: use existing peer connections to negotiate session descriptions.
  10. Since v1.6; all complex renegotiation scenarios are supported!
    1. You can select any participant to broadcast his screen or media stream in oneway direction over all connected users!
    2. There can be 5 broadcasters; and many viewers/listeners!
    3. Each and every skype-like feature is possible using v1.6! You can add/remove streams many times using existing peer connections!
  11. You can use sendCustomMessage to ask any broadcast-viewer to become broadcaster even if it was one-way broadcasting!
  12. "sendCustomMessage" is very useful in complex renegotiation scenarios!

Useful Resources

  1. How to switch streams?
  2. Renegotiation in RTCMultiConnection
  3. connection.peers (hold/unhold/drop/etc.)
  4. connection.addStream
  5. connection.renegotiate

Want to ask a Question?

You can include your email for private conversation!