Class ConnectSendTransportVideo

Connects the send transport for video by producing video data and updates the relevant states.

This function supports both a primary and a local video producer, delegating local handling to a separate function.

The options for connecting the send transport for video.

The parameters for the video producer.

The target option for the video transport connection.

The parameters for the video transport connection.

The primary video producer.

The local video producer.

The device information.

The primary producer transport.

The local producer transport.

The connection level for the video transport.

The flag to update the main window state.

The function to update the video producer state.

The function to update the local video producer state.

The function to update the producer transport state.

The function to update the local producer transport state.

The function to update the main window state.

Additional parameters for future use.

A promise that resolves when the send transport for video is connected.

Will throw an error if the connection fails.

const options = {
videoParams: {
// video producer options (e.g., codec, bitrate)
},
targetOption: "all",
parameters: {
videoProducer: null,
localVideoProducer: null,
producerTransport: transport,
localProducerTransport: localTransport,
islevel: '2',
updateMainWindow: false,
updateVideoProducer: (producer) => console.log("Updated producer"),
updateLocalVideoProducer: (localProducer) => console.log("Updated local producer"),
updateProducerTransport: (transport) => console.log("Updated transport"),
updateLocalProducerTransport: (localTransport) => console.log("Updated local transport"),
updateUpdateMainWindow: (state) => console.log("Updated main window:", state),
},
};

connectSendTransportVideo(options)
.then(() => console.log("Video transport connected successfully"))
.catch((error) => console.error("Error connecting video transport:", error));

Constructors

Methods

  • Connects the send transport for video by producing video data and updates the relevant states.

    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 send transport for video is connected.

    Will throw an error if the connection fails.

    const options = {
    videoParams: {
    // video producer options (e.g., codec, bitrate)
    },
    targetOption: "all",
    parameters: {
    videoProducer: null,
    localVideoProducer: null,
    producerTransport: transport,
    localProducerTransport: localTransport,
    islevel: '2',
    updateMainWindow: false,
    updateVideoProducer: (producer) => console.log("Updated producer"),
    updateLocalVideoProducer: (localProducer) => console.log("Updated local producer"),
    updateProducerTransport: (transport) => console.log("Updated transport"),
    updateLocalProducerTransport: (localTransport) => console.log("Updated local transport"),
    updateUpdateMainWindow: (state) => console.log("Updated main window:", state),
    },
    };

    connectSendTransportVideo(options)
    .then(() => console.log("Video transport connected successfully"))
    .catch((error) => console.error("Error connecting video transport:", error));