Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does one send WebRTC ice candidates using 'xmpp.jingle.request'? #111

Open
marcusegues opened this issue Sep 3, 2017 · 0 comments
Open

Comments

@marcusegues
Copy link

What is the correct way to send an ice candidate as a description-info Jingle message using XMPP-FTW?
Currently I have a handler on my RTCPeerConnection object as follows:

peerConnection.onicecandidate = event => {
    if (event.candidate) {
      const sdpJson = sjj.toSessionJSON(peerConnection.localDescription.sdp, {
        creators: 'initiator',
        role: 'initiator',
        direction: 'outgoing',
      });
      // not interested in sending application type data, only the transport type
      sdpJson.contents.forEach(content => {
        delete content.application;
      });
      const { peerJid, callId } = getJingleData(getState());
      xmppFtwSocket.emit(
        'xmpp.jingle.request',
        {
          to: peerJid,
          type: 'set',
          jingle: {
            action: 'description-info',
            sid: callId,
            contents: action.sdpJson.contents,
          },
        },
        (error, success) => {}
      );
    }
  };

Therefore, I'm simply grabbing my localDescription when I have a new ice candidate, because the ice candidate will be in the description at that point. and I turn it into JSON and send it via XMPP-FTW. However, the original candidate, in event.candidate also contained keys sdpMLineIndex and sdpMid, which are not sent in XMPP-FTW.

What is the correct way to send an ice candidate as a description-info Jingle message using XMPP-FTW?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant