SerenadaCallFlow

fun SerenadaCallFlow(url: String? = null, session: <Error class: unknown class>? = null, config: SerenadaCallFlowConfig = SerenadaCallFlowConfig(), theme: SerenadaCallFlowTheme = SerenadaCallFlowTheme(), roomName: String? = null, initialRemoteVideoFitCover: Boolean = true, independentContentEnabled: Boolean = false, videoMediaEnabled: Boolean = true, strings: Map<SerenadaString, String>? = null, onShareLink: () -> Unit? = null, onInviteToRoom: () -> Unit? = null, onRemoteVideoFitChanged: (Boolean) -> Unit? = null, onEndCall: () -> Unit? = null, onStartScreenShare: (<Error class: unknown class>) -> Unit? = null, onStopScreenShare: () -> Unit? = null, onSnapshotCaptured: (<Error class: unknown class>) -> Unit? = null, onSnapshotError: (<Error class: unknown class>) -> Unit? = null, onDismiss: () -> Unit = {})

Pre-built call flow that manages the full call lifecycle.

Provide either a url (URL-first) or a session (session-first) to start a call. When a url is provided, the composable creates and owns the SerenadaSession internally. When a session is provided, the caller retains ownership and is responsible for closing it.

Parameters

url

Call URL to join. Mutually exclusive with session.

session

An externally created SerenadaSession. Mutually exclusive with url.

config

Feature flags controlling which UI controls are shown.

theme

Visual customisation (colors, shapes, typography).

roomName

Optional display name shown in the call UI.

initialRemoteVideoFitCover

Whether remote video defaults to cover (crop-to-fill) mode.

strings

Localized string overrides keyed by SerenadaString.

onShareLink

Called when the user taps the share-link control. Pass null to hide it.

onInviteToRoom

Called when the user taps the invite control. Pass null to hide it.

onRemoteVideoFitChanged

Called when the user toggles remote video fit/fill mode.

onEndCall

Called when the user taps the end-call button. When null, the session leaves directly. When provided, the host owns any cleanup and dismissal for that button path.

onStartScreenShare

Called with the android.media.projection.MediaProjection consent intent when the user starts screen sharing. Use this to start a foreground service with android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION before the projection begins. When null, the session handles screen sharing directly.

onStopScreenShare

Called when the user stops screen sharing. Use this to downgrade the foreground service type. When null, the session handles it directly.

onDismiss

Called when the call ends and the UI should be dismissed, excluding a custom onEndCall button path.


fun SerenadaCallFlow(uiState: CallUiState, roomId: String, roomShareUrl: String?, eglContext: <Error class: unknown class>, roomName: String? = null, rendererProvider: CallRendererProvider? = null, initialRemoteVideoFitCover: Boolean = true, config: SerenadaCallFlowConfig = SerenadaCallFlowConfig(), theme: SerenadaCallFlowTheme = SerenadaCallFlowTheme(), strings: Map<SerenadaString, String>? = null, availableAudioDevices: List<<Error class: unknown class>> = emptyList(), currentAudioDevice: <Error class: unknown class>? = null, onToggleAudio: () -> Unit, onToggleVideo: () -> Unit, onFlipCamera: () -> Unit, onToggleFlashlight: () -> Unit = {}, onLocalPinchZoom: (Float) -> Unit = {}, onEndCall: () -> Unit, onSelectAudioDevice: (<Error class: unknown class>) -> Unit = {}, onShareLink: () -> Unit? = null, onInviteToRoom: () -> Unit = {}, onRemoteVideoFitChanged: (Boolean) -> Unit? = null, onStartScreenShare: (<Error class: unknown class>) -> Unit = {}, onStopScreenShare: () -> Unit = {}, attachLocalRenderer: (<Error class: unknown class>, <Error class: unknown class>?) -> Unit, detachLocalRenderer: (<Error class: unknown class>) -> Unit, attachLocalSink: (<Error class: unknown class>) -> Unit, detachLocalSink: (<Error class: unknown class>) -> Unit, attachRemoteRenderer: (<Error class: unknown class>, <Error class: unknown class>?) -> Unit, detachRemoteRenderer: (<Error class: unknown class>) -> Unit, attachRemoteSinkForCid: (String, <Error class: unknown class>) -> Unit, detachRemoteSinkForCid: (String, <Error class: unknown class>) -> Unit, attachRemoteSink: (<Error class: unknown class>) -> Unit, detachRemoteSink: (<Error class: unknown class>) -> Unit, attachRemoteContentSinkForCid: (String, <Error class: unknown class>) -> Unit = { _, _ -> }, detachRemoteContentSinkForCid: (String, <Error class: unknown class>) -> Unit = { _, _ -> }, attachLocalContentSink: (<Error class: unknown class>) -> Unit = {}, detachLocalContentSink: (<Error class: unknown class>) -> Unit = {}, onSnapshotRequested: (<Error class: unknown class>) -> Unit? = null, onDismiss: () -> Unit = {})

Low-level call flow composable that takes explicit state and callbacks.

Use the higher-level SerenadaCallFlow overload (with url or session) for most integrations. This overload is for hosts that manage their own SerenadaSession and need full control over every callback and renderer attachment.

Parameters

uiState

Current call UI state, typically derived from CallState.

roomId

The room identifier for the active call.

roomShareUrl

Shareable room URL (e.g. "https://serenada.app/call/<roomId>") shown in the waiting overlay's QR code and share button. Pass null (typical when running with a custom app.serenada.core.SignalingProvider and no Serenada-hosted server) to hide both controls. When using the high-level overload, SerenadaSession.roomUrl is forwarded here.

eglContext

Shared EGL context for WebRTC video rendering.

roomName

Optional display name shown in the call UI.

rendererProvider

Custom renderer provider for advanced rendering setups.

initialRemoteVideoFitCover

Whether remote video defaults to cover (crop-to-fill) mode.

config

Feature flags controlling which UI controls are shown.

theme

Visual customisation (colors, shapes, typography).

strings

Localized string overrides keyed by SerenadaString.

availableAudioDevices

Coordinator-published output routes available to the call UI.

currentAudioDevice

Currently selected or active output route, if known.

onToggleAudio

Called when the user toggles the microphone.

onToggleVideo

Called when the user toggles the camera.

onFlipCamera

Called when the user cycles the camera mode.

onToggleFlashlight

Called when the user toggles the flashlight.

onLocalPinchZoom

Called with the scale factor when the user pinch-zooms the local video.

onEndCall

Called when the user taps the end-call button.

onSelectAudioDevice

Called when the user picks an audio route.

onShareLink

Called when the user taps the share-link control. Pass null to hide it.

onInviteToRoom

Called when the user taps the invite control.

onRemoteVideoFitChanged

Called when the user toggles remote video fit/fill mode.

onStartScreenShare

Called with the MediaProjection consent intent when screen sharing starts.

onStopScreenShare

Called when screen sharing stops.

attachLocalRenderer

Attaches a SurfaceViewRenderer for the local video track.

detachLocalRenderer

Detaches the local video renderer.

attachLocalSink

Attaches a VideoSink for the local video track.

detachLocalSink

Detaches the local video sink.

attachRemoteRenderer

Attaches a SurfaceViewRenderer for the remote video track.

detachRemoteRenderer

Detaches the remote video renderer.

attachRemoteSinkForCid

Attaches a VideoSink for a specific remote participant by CID.

detachRemoteSinkForCid

Detaches the video sink for a specific remote participant.

attachRemoteSink

Attaches a VideoSink for the remote video track.

detachRemoteSink

Detaches the remote video sink.

onDismiss

Called when the call ends and the UI should be dismissed.