CameraViewCallback typedef

CameraViewCallback = void Function(int viewId)

Renders a single video stream, used for local camera preview or remote playback.

This name is kept to stay consistent with the native platforms (Kotlin / iOS / OHOS) and with DeviceStore.startCameraTest.

CameraView is currently a thin wrapper over the internal VideoView, so the rendering implementation is not duplicated. It keeps its own definition so that camera-test specific capabilities can be added here later without affecting VideoView.

Usage:

  1. Place CameraView in the widget tree and keep it visible.
  2. Get the render view id from onViewCreated.
  3. Pass the view id to the APIs that need a render view, such as DeviceStore.startCameraTest.

Important: The view id is delivered asynchronously by onViewCreated, so it is not available right after the widget is constructed. Passing 0 sets no render target, and nothing will be drawn.

Implementation

typedef CameraViewCallback = void Function(int viewId);