disconnect Send Transport Screen
Disconnects the send transport for screen sharing by closing the screen producer and notifying the server.
This function handles both remote and local screen transport disconnection. It manages producer lifecycle and ensures proper cleanup of screen sharing resources.
Workflow:
Local Transport Disconnection:
Disconnects local screen transport if available
Closes local screen producer
Notifies local server
Remote Transport Disconnection:
Closes remote screen producer if it exists
Notifies remote server about closed producer
State Cleanup:
Clears screen producer references
Updates all relevant state parameters
Server Notification:
Emits closeScreenProducer event
Emits pauseProducerMedia event with screen tag
Return
Result indicating success or failure
Example usage:
val options = DisconnectSendTransportScreenOptions(
parameters = myParameters
)
disconnectSendTransportScreen(options).onSuccess {
Logger.e("DisconnectSendTransp", "Screen transport disconnected successfully")
}.onFailure { error ->
Logger.e("DisconnectSendTransp", "Disconnection failed: ${error.message}")
}Parameters
Configuration options for disconnecting screen transport