SerenadaSession

Represents an active call session. Created via SerenadaCore.join or SerenadaCore.createRoom.

Observe state for app-facing call state changes and diagnostics for low-level transport/media details. Control the call via leave, end, toggleAudio, toggleVideo, etc.

Properties

Link copied to clipboard

Real-time connection diagnostics (stats, transport state, ICE state).

Link copied to clipboard
Link copied to clipboard

Callback invoked when camera/microphone permissions are needed before joining.

Link copied to clipboard

The room ID for this call session.

Link copied to clipboard

Full URL for this call session (e.g. "https://serenada.app/call/ABC123").

Link copied to clipboard
val state: StateFlow<CallState>

Primary observable call state. Collect this flow for UI updates.

Functions

Link copied to clipboard
fun adjustLocalCameraZoom(scaleFactor: Float)

Adjust the camera zoom level by the given scale factor.

Link copied to clipboard
fun attachLocalRenderer(renderer: SurfaceViewRenderer, rendererEvents: RendererCommon.RendererEvents? = null)

Attach a SurfaceViewRenderer for local video preview.

Link copied to clipboard
fun attachLocalSink(sink: VideoSink)
Link copied to clipboard
fun attachRemoteRenderer(renderer: SurfaceViewRenderer, rendererEvents: RendererCommon.RendererEvents? = null)

Attach a SurfaceViewRenderer for remote video.

Link copied to clipboard
fun attachRemoteRendererForCid(cid: String, renderer: SurfaceViewRenderer, rendererEvents: RendererCommon.RendererEvents? = null)
Link copied to clipboard
fun attachRemoteSink(sink: VideoSink)
Link copied to clipboard
fun attachRemoteSinkForCid(cid: String, sink: VideoSink)
Link copied to clipboard

Cancel an in-progress join attempt.

Link copied to clipboard
fun captureLocalSnapshot(onResult: (ByteArray?) -> Unit)

Capture a JPEG snapshot of the local video frame.

Link copied to clipboard
fun detachLocalRenderer(renderer: SurfaceViewRenderer)

Detach a previously attached local video renderer.

Link copied to clipboard
fun detachLocalSink(sink: VideoSink)
Link copied to clipboard
fun detachRemoteRenderer(renderer: SurfaceViewRenderer)

Detach a previously attached remote video renderer.

Link copied to clipboard
fun detachRemoteRendererForCid(cid: String, renderer: SurfaceViewRenderer)
Link copied to clipboard
fun detachRemoteSink(sink: VideoSink)
Link copied to clipboard
fun detachRemoteSinkForCid(cid: String, sink: VideoSink)
Link copied to clipboard
fun eglContext(): EglBase.Context

Get the EGL context for custom rendering or renderer initialization.

Link copied to clipboard
fun end()

End the call for all participants.

Link copied to clipboard

Cycle to the next camera mode (selfie -> world -> composite).

Link copied to clipboard
fun leave()

Leave the call gracefully. The other participant stays in the room.

Link copied to clipboard

Resume joining after camera/microphone permissions have been granted.

Link copied to clipboard

Set a specific camera mode.

Link copied to clipboard

Start screen sharing using the given media projection intent.

Link copied to clipboard

Stop screen sharing and return to camera.

Link copied to clipboard

Toggle local audio on or off.

Link copied to clipboard

Toggle the device flashlight on or off.

Link copied to clipboard

Toggle local video on or off.