AndroidWebRtcDevice

Android implementation of the WebRTC device backed by mediasoup-client.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun captureWhiteboardStream(shapesProvider: () -> List<Any>, useImageBackgroundProvider: () -> Boolean, width: Int, height: Int, frameRate: Int): MediaStream

Captures the whiteboard canvas as a video stream for recording. Similar to HTML Canvas's captureStream(30) API in web browsers.

Link copied to clipboard
open override fun close()

Releases device resources.

Link copied to clipboard
open override fun createRecvTransport(params: Map<String, Any?>): WebRtcTransport

Creates a receive transport from parameters.

Link copied to clipboard
open override fun createSendTransport(params: Map<String, Any?>): WebRtcTransport

Creates a send transport from parameters.

Link copied to clipboard
open override fun createVirtualVideoSource(width: Int, height: Int, frameRate: Int): VirtualVideoSource

Creates a virtual video source for feeding processed frames (e.g., from ML Kit virtual backgrounds).

Link copied to clipboard

Returns the device's currently loaded RTP capabilities, if available. Implementations can override to provide the platform-specific snapshot; the default returns {@code null} for platforms that do not expose it yet.

Link copied to clipboard
open suspend override fun enumerateDevices(): List<MediaDeviceInfo>

Enumerates the available media devices.

Link copied to clipboard
open suspend override fun getDisplayMedia(constraints: Map<String, Any?>): MediaStream

Captures the screen for sharing using MediaProjection API.

Link copied to clipboard
open suspend override fun getUserMedia(constraints: Map<String, Any?>): MediaStream

Retrieves a media stream for the given constraints (camera/microphone).

Link copied to clipboard
open suspend override fun load(rtpCapabilities: RtpCapabilities): Result<Unit>

Loads RTP capabilities for the device.

Link copied to clipboard
open suspend override fun setAudioOutputDevice(deviceId: String): Boolean

Sets the audio output device for playback.