captureWhiteboardStream

open suspend fun captureWhiteboardStream(shapesProvider: () -> List<Any>, useImageBackgroundProvider: () -> Boolean = { false }, width: Int = 1280, height: Int = 720, frameRate: Int = 30): MediaStream?

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

This renders the whiteboard shapes to a bitmap at the specified frame rate and converts it to a WebRTC video stream.

Return

MediaStream containing the whiteboard video track

Parameters

shapesProvider

Lambda that returns the current list of whiteboard shapes

useImageBackgroundProvider

Lambda that returns whether to use image background (grid)

width

Width of the capture (default 1280)

height

Height of the capture (default 720)

frameRate

Target frame rate (default 30fps)