The options for closing the producer.
A promise that resolves when the producer has been successfully closed.
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);
});
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.