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.

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

import { producerClosed } from 'mediasfu-reactnative-expo';

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);
});