connectRecvTransport

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:

  1. Consumption Initiation: Emits a consume event to the socket to initiate media consumption

  2. Consumer Transport Management: Adds the transport and consumer details to the consumerTransports list

  3. Stream Resumption: Emits a consumer-resume event to resume media reception

  4. Consumer Resume: Triggers consumerResume to update the UI and media handling

Workflow:

  1. Add to Transport List: Adds the new consumer transport to tracking list

  2. Extract Stream: Gets the media stream from the consumer

  3. Emit Resume Event: Sends consumer-resume event with acknowledgment

  4. Handle Resume Response: Calls consumerResume on successful response

  5. Error Handling: Logs errors during consumption or resumption

Parameters

options

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