closeAndAwait

suspend fun closeAndAwait()

Closes the player and returns only after the session actor and teardown have completed.

Concurrent calls and close share one terminal result. Caller cancellation remains a CancellationException and stops only that caller's wait; it never cancels the independently owned teardown. The worker-ownership join is deliberately non-cancellable and can outlive the close deadline when native code wedges, in which case a caller may ultimately have to terminate the process.

Throws

with PlaybackError.RuntimeCompromised for every compromised outcome the core can report instead of a completed close.