connect Recv Transport
Establishes a connection for the receiving transport to consume media from a remote producer and resumes the consumer stream.
This function manages the complete workflow for receiving media from a remote producer:
Consumption Initiation: Emits a
consumeevent to the socket to initiate media consumptionConsumer Transport Management: Adds the transport and consumer details to the
consumerTransportslistStream Resumption: Emits a
consumer-resumeevent to resume media receptionConsumer Resume: Triggers
consumerResumeto update the UI and media handling
Workflow:
Add to Transport List: Adds the new consumer transport to tracking list
Extract Stream: Gets the media stream from the consumer
Emit Resume Event: Sends consumer-resume event with acknowledgment
Handle Resume Response: Calls consumerResume on successful response
Error Handling: Logs errors during consumption or resumption
Parameters
Options containing consumer, transport, and connection details
Example:
val options = ConnectRecvTransportOptions(
consumer = myConsumer,
consumerTransport = myConsumerTransport,
remoteProducerId = "producer-id-123",
serverConsumerTransportId = "transport-id-abc",
nsock = mySocket,
parameters = myConnectRecvTransportParameters
)
connectRecvTransport(options)Note:
This is a simplified stub implementation. Full implementation requires:
Platform-specific WebRTC Consumer and Transport handling
MediaStream extraction from Consumer
Consumer ID retrieval
Consumer kind detection (audio/video)
Socket emit with acknowledgment support
Full ConsumerResume implementation