CameraInfoModule Module

The CameraInfoModule class provides access to details about the device camera.

Usage

var CameraInfo = require('CameraInfo');

Properties

PropertyDescription

captureDevicePosition

read-only: CameraPosition

Specifies a CameraPosition enum value identifying the current camera in use on the device.

effectSafeAreaInsets

read-only: InsetsSignal

Specifies an InsetsSignal indicating the insets of the effect safe area.

isRecordingVideo

read-only: BoolSignal

Specifies a BoolSignal that indicates whether the camera is recording video.

onAfterCaptureStillImage

read-only: EventSource

Specifies an EventSource that emits an event after a still image is taken.

previewSize

read-only: PixelSizeSignal

Specifies a PixelSizeSignal describing the size of the preview, in pixels.

Methods

This class exposes no methods.

Enums

EnumDescription

CameraPosition

The CameraPosition enum describes the direction the camera is facing.

Example

The following example demonstrates how to monitor the camera for a change in the recording state.

var R = require('Reactive');
var CameraInfo = require('CameraInfo');

// Subscribe to the video recording state
var driver = CameraInfo.isRecordingVideo.monitor().subscribe(
  function (result) {
    // Respond to the status change
    if (result.newValue) { 
        // Camera is recording
    }
  }
);