Disconnects the send transport for video, closes the video producer, and updates the state.
This function supports both a primary and a local video producer, delegating local handling to a separate function.
The options for disconnecting the send transport.
A promise that resolves when the disconnection process is complete.
const options = {
parameters: {
videoProducer: videoProducerInstance,
localVideoProducer: localVideoProducerInstance,
socket: socketInstance,
localSocket: localSocketInstance,
islevel: '2',
roomName: 'Room A',
updateMainWindow: false,
lock_screen: false,
updateUpdateMainWindow: (state) => console.log('Main window updated:', state),
updateVideoProducer: (producer) => console.log('Video producer updated:', producer),
updateLocalVideoProducer: (producer) => console.log('Local video producer updated:', producer),
reorderStreams: reorderStreamsFunction,
},
};
disconnectSendTransportVideo(options)
.then(() => console.log('Video send transport disconnected successfully'))
.catch((error) => console.error('Error disconnecting video send transport:', error));
Disconnects the send transport for video, closes the video producer, and updates the state.
This function supports both a primary and a local video producer, delegating local handling to a separate function.
Param: options
The options for disconnecting the send transport.
Param: options.parameters
The parameters required for disconnecting the send transport.
Param: options.parameters.videoProducer
The primary video producer object.
Param: options.parameters.localVideoProducer
The local video producer object (optional).
Param: options.parameters.socket
The primary socket object.
Param: options.parameters.localSocket
The local socket object (optional).
Param: options.parameters.islevel
The participant's level.
Param: options.parameters.roomName
The name of the room.
Param: options.parameters.updateMainWindow
The flag to update the main window.
Param: options.parameters.lock_screen
The flag to lock the screen.
Param: options.parameters.updateUpdateMainWindow
The function to update the main window state.
Param: options.parameters.updateVideoProducer
The function to update the video producer state.
Param: options.parameters.updateLocalVideoProducer
The function to update the local video producer state (optional).
Param: options.parameters.reorderStreams
The function to reorder streams.
Param: options.parameters.updateLocalProducerTransport
The function to update the local producer transport state (optional).
Param: options.parameters.updateProducerTransport
The function to update the producer transport state (optional).
Returns
A promise that resolves when the disconnection process is complete.
Throws
Throws an error if the disconnection process fails.
Example