How Device and Transport work together
v3The Device is the central entry point for mediasoup-client. It represents the client-side capabilities and manages the creation of transports.
Device.load({ routerRtpCapabilities }): This method initializes the device with the capabilities of the remote mediasoup router. This is a prerequisite for any media operations.Device.createSendTransport(options): Creates a local representation of a server-side send transport. Theoptionsmust include parameters likeid,iceParameters,iceCandidates,dtlsParameters, andsctpParametersobtained from the server.TransportEvents: Transports are not fully functional until their event handlers are wired to your signaling server. The most critical events are:connect: Triggered when the transport needs to exchange DTLS parameters to establish a secure connection.produce: Triggered when a producer (like a video track) is being created and needs to send its RTP parameters to the server.producedata: Triggered when a data producer (DataChannel) is being created.