startPreview

abstract fun startPreview(surfaceProvider: Preview.SurfaceProvider, requireTakePictureCapability: Boolean = true)

Initializes a continuous stream of preview frames.

Parameters

surfaceProvider

The provider of the surface where the frames will display on.

requireTakePictureCapability

Determines whether manual picture-taking capabilities should be enabled or disabled.


abstract fun startPreview(surfaceHolder: SurfaceHolder, requireTakePictureCapability: Boolean = true)

Deprecated

Use startPreview(Preview.SurfaceProvider) instead, this method will not be supported in future versions.

Initializes a continuous stream of preview frames.

Parameters

surfaceHolder

The holder of the surface where the frames will display on.

requireTakePictureCapability

Determines whether manual picture-taking capabilities should be enabled or disabled.


abstract fun startPreview(surface: Surface, requireTakePictureCapability: Boolean = true)

Deprecated

Use startPreview(Preview.SurfaceProvider) instead, this method will not be supported in future versions.

Initializes a continuous stream of preview frames.

Parameters

surface

The surface where the frames will display on.

requireTakePictureCapability

Determines whether manual picture-taking capabilities should be enabled or disabled.