Compose Camera LogoCompose Camera

CameraInfo

Reading camera state and capabilities.

CameraInfo

CameraInfo provides observable state regarding the camera's current status and capabilities.

Properties

PropertyTypeDescription
zoomStateStateFlow<ZoomState>Current zoom ratio and range.
exposureStateStateFlow<ExposureState>Current exposure index and range.
cameraStateStateFlow<CameraState>General camera lifecycle state.
hasFlashUnitBooleanWhether the active camera has a flash unit.
hasTorchBooleanWhether the active camera has a torch unit.

Checking Capabilities

You can inspect CameraInfo to determine if features are supported.

if (cameraInfo.hasFlashUnit) {
    // Show flash button
}

On this page