Connects to remote IPs and manages socket connections.
This method establishes connections to remote IPs for media streaming, handles new pipe producer events, and manages producer closure events. It updates the necessary state in the application to reflect the current connections and stream configurations.
The options for connecting IPs.
A promise that resolves when the connection is established.
Connects to remote IPs and manages socket connections.
This method establishes connections to remote IPs for media streaming, handles new pipe producer events, and manages producer closure events. It updates the necessary state in the application to reflect the current connections and stream configurations.
Param: options
The options for connecting IPs.
Param: options.socket
The socket connection to use for communication.
Param: options.newProducerMethod
The method to handle new pipe producer events (default: newPipeProducer).
Param: options.closedProducerMethod
The method to handle producer closed events (default: producerClosed).
Param: options.parameters
Additional parameters for the operation.
Returns
A promise that resolves when the connection is established.
Throws
Will throw an error if required parameters are missing or if there is an issue connecting to a remote IP.
Example