RtcSession

class RtcSession(context: Context, uri: Uri, mode: StreamSession.Mode = StreamSession.Mode.PUBLISH, configuration: RtcConfiguration = RtcConfiguration()) : StreamSession

WHIP publishing or WHEP playback over HTTP(S), using a non-trickle ICE offer. A session owns one reusable stream. Register its stream with a mixer for publishing or attach a StreamView for playback. Close before reconnecting. Configure settings while closed. Cancellation disconnects the active HTTP request; redirects and response reads share an absolute HTTP deadline before cleanup and reconnection.

Constructors

Link copied to clipboard
constructor(context: Context, uri: Uri, mode: StreamSession.Mode = StreamSession.Mode.PUBLISH, configuration: RtcConfiguration = RtcConfiguration())

Properties

Link copied to clipboard
open override val events: SharedFlow<StreamSessionEvent>
Link copied to clipboard
val failure: StateFlow<Throwable?>

Most recent asynchronous transport/media/cleanup failure; reset on connect.

Link copied to clipboard
open override val hasLifecycleEvents: Boolean = true
Link copied to clipboard
open override val isConnected: Boolean
Link copied to clipboard
open override val readyState: StateFlow<StreamSession.ReadyState>
Link copied to clipboard
open override val stream: RtcStream

Functions

Link copied to clipboard
open suspend override fun close(): Result<Unit>
Link copied to clipboard
open suspend override fun connect(): Result<Unit>
Link copied to clipboard
open override fun getStatistics(resetInterval: Boolean): StreamSessionStatistics?