MediaSFU Angular
    Preparing search index...

    Function createLocalSendTransport

    • Creates a WebRTC send transport and sets up event handlers for the transport. Supports both primary and local transports with modular handling.

      Parameters

      Returns Promise<void>

      A promise that resolves when the send transport is created and configured.

      Will throw an error if there is an issue creating the send transport.

      const options = {
      option: 'video',
      parameters: {
      islevel: '1',
      member: 'John Doe',
      socket: socketInstance,
      localSocket: localSocketInstance,
      device: deviceInstance,
      producerTransport: null,
      localProducerTransport: null,
      transportCreated: false,
      localTransportCreated: false,
      updateProducerTransport: (transport) => console.log('Primary transport updated:', transport),
      updateLocalProducerTransport: (transport) => console.log('Local transport updated:', transport),
      updateTransportCreated: (state) => console.log('Primary transport created:', state),
      updateLocalTransportCreated: (state) => console.log('Local transport created:', state),
      },
      };
      createSendTransport(options)
      .then(() => console.log('Send transport created successfully'))
      .catch((error) => console.error('Error creating send transport:', error));