NativePreviewView

actual fun NativePreviewView(previewOutput: CameraPreviewOutput?, modifier: Modifier, resizeMode: PreviewResizeMode, implementationMode: PreviewImplementationMode, gestureControllers: List<GestureController>, ref: PreviewViewRef?, onPreviewStarted: () -> Unit?, onPreviewStopped: () -> Unit?)

Displays the Camera feed in a CameraX-backed Android PreviewView, see the common declaration.

expect fun NativePreviewView(previewOutput: CameraPreviewOutput?, modifier: Modifier = Modifier, resizeMode: PreviewResizeMode = PreviewResizeMode.COVER, implementationMode: PreviewImplementationMode = PreviewImplementationMode.PERFORMANCE, gestureControllers: List<GestureController> = emptyList(), ref: PreviewViewRef? = null, onPreviewStarted: () -> Unit? = null, onPreviewStopped: () -> Unit? = null)

Displays the Camera feed of a CameraPreviewOutput, using the platform's native preview view (me.nathanfallet.visioncamera.PreviewView, an Android View or an iOS UIView).

Parameters

previewOutput

The CameraPreviewOutput to display.

modifier

The Modifier of this view.

resizeMode

How the Camera feed is scaled into the view's bounds.

implementationMode

Whether the preview uses a SurfaceView or a TextureView (Android only).

gestureControllers

Native GestureControllers to install on the view, see rememberGestureControllers.

ref

A PreviewViewRef to call the view's methods, e.g. to create metering points.

onPreviewStarted

Called when the preview started streaming.

onPreviewStopped

Called when the preview stopped streaming.

actual fun NativePreviewView(previewOutput: CameraPreviewOutput?, modifier: Modifier, resizeMode: PreviewResizeMode, implementationMode: PreviewImplementationMode, gestureControllers: List<GestureController>, ref: PreviewViewRef?, onPreviewStarted: () -> Unit?, onPreviewStopped: () -> Unit?)

Displays the Camera feed in an AVFoundation-backed iOS PreviewView, see the common declaration.