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.
The options for disconnecting the send transport.
A promise that resolves when the disconnection process is complete.
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);
});
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.
Param: options
The options for disconnecting the send transport.
Param: options.parameters
The parameters required for disconnection.
Param: options.parameters.getUpdatedAllParams
Function to get updated parameters.
Param: options.parameters.screenProducer
The screen producer to be closed.
Param: options.parameters.socket
The socket connection to notify the server.
Param: options.parameters.localSocket
The local socket connection for communication.
Param: options.parameters.roomName
The name of the room.
Param: options.parameters.updateScreenProducer
Function to update the screen producer state.
Param: options.parameters.updateLocalScreenProducer
Function to update the local screen producer state.
Returns
A promise that resolves when the disconnection process is complete.
Throws
If an error occurs during the disconnection process.
Example