MediaSFU React Native
    Preparing search index...

    Function disconnectSendTransportScreen

    • Disconnects the send transport for screen sharing.

      This function closes the screen producer, updates the state, and notifies the server about the closure and pausing of screen sharing.

      Parameters

      Returns Promise<void>

      A promise that resolves when the disconnection process is complete.

      If an error occurs during the disconnection process.

      const options = {
      parameters: {
      screenProducer: screenProducerInstance,
      socket: socketInstance,
      localSocket: localSocketInstance,
      roomName: 'Room 1',
      updateScreenProducer: (producer) => console.log('Updated screen producer:', producer),
      updateLocalScreenProducer: (localProducer) => console.log('Updated local screen producer:', localProducer),
      getUpdatedAllParams: () => ({
      screenProducer: screenProducerInstance,
      socket: socketInstance,
      roomName: 'Room 1',
      }),
      },
      };

      disconnectSendTransportScreen(options)
      .then(() => {
      console.log('Screen send transport disconnected successfully');
      })
      .catch((error) => {
      console.error('Error disconnecting screen send transport:', error);
      });