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.
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)); Copy
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));
The options for connecting the send transport for video.
A promise that resolves when the send transport for video is connected.
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.
Throws
Will throw an error if the connection fails.
Example