MediaSFU React Native
    Preparing search index...

    Function producerClosed

    • Handles the closure of a producer identified by its remote producer ID. This function will clean up the consumer transports and resize the video outputs.

      Parameters

      Returns Promise<void>

      A promise that resolves when the producer has been successfully closed.

      Will throw an error if there is an issue closing the consumer transport or the producer.

      import { producerClosed } from 'mediasfu-reactnative';

      const options = {
      remoteProducerId: 'producerId',
      parameters: {
      consumerTransports: [], // Array of consumer transports
      closeAndResize: (params) => console.log('Close and resize called', params),
      screenId: 'screenId',
      updateConsumerTransports: (transports) => console.log('Updated transports:', transports),
      },
      };

      producerClosed(options)
      .then(() => {
      console.log('Producer closed successfully');
      })
      .catch((error) => {
      console.error('Error closing producer:', error);
      });