A promise that resolves when the transport is connected.
Throws
Will throw an error if the connection fails.
Example
constoptions = { 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, }, };
Connects the send transport based on the specified option.
Param: options
The options for connecting the send transport.
Param: options.option
The type of transport to connect ("audio", "video", "screen", or "all").
Param: options.targetOption
The target of the transport to connect ("local", "remote", or "all").
Param: options.parameters
The parameters required for connecting the transport.
Param: options.parameters.audioParams
The audio parameters.
Param: options.parameters.videoParams
The video parameters.
Param: options.parameters.localStreamScreen
The local screen stream.
Param: options.parameters.canvasStream
The canvas stream.
Param: options.parameters.whiteboardStarted
Indicates if the whiteboard has started.
Param: options.parameters.whiteboardEnded
Indicates if the whiteboard has ended.
Param: options.parameters.shared
Indicates if the screen is shared.
Param: options.parameters.islevel
The level of the screen sharing.
Param: options.parameters.connectSendTransportAudio
Function to connect the audio send transport.
Param: options.parameters.connectSendTransportVideo
Function to connect the video send transport.
Param: options.parameters.connectSendTransportScreen
Function to connect the screen send transport.
Returns
A promise that resolves when the transport is connected.
Throws
Will throw an error if the connection fails.
Example