joinConsumeRoom

Joins a consumption room, initiates a media Device if necessary, and sets up piped transports for streaming.

This function:

  1. Sends a request to join a specified consumption room using provided authentication details.

  2. Checks if a media Device needs to be initialized, and creates it using RTP capabilities if required.

  3. Calls receiveAllPipedTransports to establish the necessary piped transports for media sharing.

Return

A ResponseJoinRoom containing the result of the join operation

Parameters

options

An options object containing socket, authentication, and room parameters

Throws

if there is an error joining the room, creating the Device, or setting up piped transports

Example:

val parameters = object : JoinConsumeRoomParameters {
override val roomName = "test-room"
override val islevel = "2"
override val member = "user123"
override val device = null
override val createDeviceClient = { options -> null }
override fun getUpdatedAllParams() = this
}

val options = JoinConsumeRoomOptions(
remoteSock = socket,
apiToken = "your-api-token",
apiUserName = "test-user",
parameters = parameters
)

val response = joinConsumeRoom(options)