CameraInfoModule

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

Example

//==============================================================================
// The following example demonstrates how to hide an object when capturing a
// photo or recording a video.
//
// Project setup:
// - Insert a plane
//==============================================================================

// Load in the required modules
const CameraInfo = require('CameraInfo');
const Scene = require('Scene');

// Enable async/await in JS [part 1]
(async function() {
  // Locate the plane in the Scene
  const [plane] = await Promise.all([
    Scene.root.findFirst('plane0')
  ]);

  //==============================================================================
  // Hide the plane when capturing a photo or recording a video
  //==============================================================================

  // Store references to the photo capture and video recording boolean signals
  const isCapturingPhoto = CameraInfo.isCapturingPhoto;
  const isRecordingVideo = CameraInfo.isRecordingVideo;

  // Create a boolean signal that returns true if either boolean signal are true
  const hidePlane = isCapturingPhoto.or(isRecordingVideo);

  // Bind the hidePlane signal to the hidden property of the plane
  plane.hidden = hidePlane;
// Enable async/await in JS [part 2]
})();

Properties

PropertyDescription
captureDevicePosition
(get) captureDevicePosition: Signal<CameraPosition>
(set) (Not Available)


Specifies a CameraPosition enum signal identifying the current camera in use on the device.
effectSafeAreaInsets
(get) effectSafeAreaInsets: Point4DSignal
(set) (Not Available)


Specifies a Point4DSignal indicating the insets of the effect safe area.
isCapturingPhoto
(get) isCapturingPhoto: BoolSignal
(set) (Not Available)


Specifies a BoolSignal that indicates whether the camera is capturing a photo.
isRecordingVideo
(get) isRecordingVideo: BoolSignal
(set) (Not Available)


Specifies a BoolSignal that indicates whether the camera is recording video.
previewScreenScale
(get) previewScreenScale: ScalarSignal
(set) (Not Available)


Specifies a ScalarSignal describing the scale of the preview's screen, i.e. the number of pixels per point.
previewSize
(get) previewSize: Point2DSignal
(set) (Not Available)


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

Methods

This module exposes no methods.

Classes

This module exposes no classes.

Enums

EnumDescription
CameraPositionThe CameraPosition enum describes the direction the camera is facing.