sendTransport 'connect' event not firing

Hi all,

I’m trying to create a send transport on the client side using the code below. I’ve already received the transport parameters from the server and I am trying to make the client side one.

When I run the code below, I don’t get any errors, but the connect event never fires.

I’ve already looked at the client and serverside debugging statements and nothing strange has popped out at me. Any help would be greatly appreciated.

function createSendTransport(device, params) {
  return new Promise((resolve, reject) => {
    const sendTransport = device.createSendTransport(params);

    sendTransport.on('connect', ({ dtlsParameters }, callback, errback) => {
      console.log("sendTransport connect event fired");
      const res = {
        sendTransport,
        dtlsParameters,
        callback,
        errback,
      };
      resolve(res);
    });

    sendTransport.on('connectionstatechange', async (connectionState) => {
      console.log("send connection state changed");
      console.log(connectionState);
    });
  });
}
1 Like

Due to PeerConnection nature, no ICE will be connected until you add or receive an audio/video track or a datachannel. No bug here.

1 Like