newPipeProducer

Initiates a new pipe producer by signaling a new consumer transport and updating display settings.

This function performs the following steps:

  1. Signals the creation of a new consumer transport for the specified producerId.

  2. Updates the firstRound and landScaped display parameters based on sharing mode and device orientation.

  3. Optionally, triggers an alert to prompt the user to rotate their device for optimal viewing if screen sharing is active and the device is not in landscape mode.

Parameters

options

Contains the required data for handling the new pipe producer

Example:

val parameters = object : NewPipeProducerParameters {
override val firstRound = true
override val shareScreenStarted = true
override val shared = false
override val landScaped = false
override val isWideScreen = false
override val device = null
override val consumingTransports = emptyList()
override val lockScreen = false
override val showAlert = { message, type, duration ->
}
override val updateConsumingTransports = { transports -> }
override val connectRecvTransport = { opts -> }
override val reorderStreams = { opts -> }
override val signalNewConsumerTransport = { opts -> }
override fun getUpdatedAllParams() = this
}

val options = NewPipeProducerOptions(
producerId = "producer-123",
islevel = "2",
nsock = socketInstance,
parameters = parameters
)

newPipeProducer(options)