disconnectSendTransportAudio

Disconnects the send transport for audio by pausing the audio producer and notifying the server.

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

Workflow:

  1. Local Transport Disconnection:

    • Disconnects local audio transport if available

    • Pauses local audio producer

  2. Remote Transport Disconnection:

    • Pauses remote audio producer if it exists

    • Notifies server about paused producer

  3. UI State Update:

    • Updates main window if needed based on screen state

    • Repopulates user media display

  4. State Cleanup:

    • Clears audio producer references

    • Updates all relevant state parameters

Return

Result indicating success or failure

Example usage:

val options = DisconnectSendTransportAudioOptions(
parameters = myParameters
)

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

Parameters

options

Configuration options for disconnecting audio transport