Class ConnectSendTransport

Connects the send transport based on the specified option.

The options for connecting the send transport.

The type of transport to connect ("audio", "video", "screen", or "all").

The target of the transport to connect ("local", "remote", or "all").

The parameters required for connecting the transport.

The audio parameters.

The video parameters.

The local screen stream.

The canvas stream.

Indicates if the whiteboard has started.

Indicates if the whiteboard has ended.

Indicates if the screen is shared.

The level of the screen sharing.

Function to connect the audio send transport.

Function to connect the video send transport.

Function to connect the screen send transport.

A promise that resolves when the transport is connected.

Will throw an error if the connection fails.

const options = {
option: 'audio', // Can be 'audio', 'video', 'screen', or 'all'
targetOption: 'local', // Can be 'local', 'remote', or 'all'
parameters: {
audioParams: { codec: 'opus' },
videoParams: { codec: 'vp8' },
localStreamScreen: null, // Set to your local screen stream
canvasStream: null, // Set to your canvas stream if using
whiteboardStarted: false,
whiteboardEnded: true,
shared: false,
islevel: '1',
connectSendTransportAudio: connectSendTransportAudioFunction,
connectSendTransportVideo: connectSendTransportVideoFunction,
connectSendTransportScreen: connectSendTransportScreenFunction,
updateVideoProducer: () => {},
updateProducerTransport: () => {},
updateScreenProducer: () => {},
updateMainWindow: false,
},
};

connectSendTransport(options)
.then(() => {
console.log('Transport connected successfully');
})
.catch((error) => {
console.error('Error connecting transport:', error);
});

Constructors

Methods

Constructors

Methods