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.
A promise that resolves when the send transport for video is connected.
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));
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.
Param: options
The options for connecting the send transport for video.
Param: options.videoParams
The parameters for the video producer.
Param: options.targetOption
The target option for the video transport connection.
Param: options.parameters
The parameters for the video transport connection.
Param: options.parameters.videoProducer
The primary video producer.
Param: options.parameters.localVideoProducer
The local video producer.
Param: options.parameters.device
The device information.
Param: options.parameters.producerTransport
The primary producer transport.
Param: options.parameters.localProducerTransport
The local producer transport.
Param: options.parameters.islevel
The connection level for the video transport.
Param: options.parameters.updateMainWindow
The flag 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.
Param: options.parameters.updateProducerTransport
The function to update the producer transport state.
Param: options.parameters.updateLocalProducerTransport
The function to update the local producer transport state.
Param: options.parameters.updateUpdateMainWindow
The function to update the main window state.
Param: options.parameters
Additional parameters for future use.
Returns
A promise that resolves when the send transport for video is connected.
Throws
Will throw an error if the connection fails.
Example