disconnectSendTransportVideo

Disconnects the send transport for video by closing the video producer and notifying the server.

This function handles both remote and local video transport disconnection. It manages producer lifecycle, updates UI state, and ensures proper cleanup of video resources.

Workflow:

  1. Local Transport Disconnection:

    • Disconnects local video transport if available

    • Closes local video producer

  2. Remote Transport Disconnection:

    • Closes remote video producer if it exists

    • Notifies server about closed producer

  3. UI State Update:

    • Updates main window if needed based on screen state

    • Repopulates user media display

  4. State Cleanup:

    • Sets video producer references to null

    • Updates all relevant state parameters

Return

Result indicating success or failure

Example usage:

val options = DisconnectSendTransportVideoOptions(
parameters = myParameters
)

disconnectSendTransportVideo(options).onSuccess {
Logger.e("DisconnectSendTransp", "Video transport disconnected successfully")
}.onFailure { error ->
Logger.e("DisconnectSendTransp", "Disconnection failed: ${error.message}")
}

Parameters

options

Configuration options for disconnecting video transport