Class DisconnectSendTransportVideo

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.

The parameters required for disconnecting the send transport.

The primary video producer object.

The local video producer object (optional).

The primary socket object.

The local socket object (optional).

The participant's level.

The name of the room.

The flag to update the main window.

The flag to lock the screen.

The function to update the main window state.

The function to update the video producer state.

The function to update the local video producer state (optional).

The function to reorder streams.

The function to update the local producer transport state (optional).

The function to update the producer transport state (optional).

A promise that resolves when the disconnection process is complete.

Throws an error if the disconnection process fails.

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

Constructors

Methods

  • 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.

    Parameters

    Returns Promise<void>

    A promise that resolves when the disconnection process is complete.

    Throws an error if the disconnection process fails.

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