Skip to main content

CameraModule.CameraInfo

Class

A physical camera on SPECS, returned by CameraModule#getCameras.

  • Snapchat: not supported
  • SPECS: fully supported
  • Camera Kit Web: not supported
  • Camera Kit Mobile: not supported
1 platform note
  • SnapchatNot supported — Available on SPECS only
  • SPECSFully supported
    • Restricted when the Lens uses internet-connected APIs (see Privacy Restrictions).
  • Camera Kit WebNot supported — Available on SPECS only
  • Camera Kit MobileNot supported — Available on SPECS only

Platform details

  • Snapchat — Not supported — Available on SPECS only.

  • SPECS — Fully supported. Restricted when the Lens uses internet-connected APIs (see Privacy Restrictions)

  • Camera Kit Web — Not supported — Available on SPECS only.

  • Camera Kit Mobile — Not supported — Available on SPECS only.

Since Lens Scripting v387Exposes user data

A physical camera on SPECS, returned by CameraModule#getCameras.

Index

Remarks

Identity (type, location, facing, name) comes from the camera service. Call CameraModule.CameraInfo#getStreams for the camera's stream capabilities and pass one of them to CameraModule.StreamConfig#stream.

Extends

Properties

facing

readonly facing: CameraFacing

Exposes user dataSPECS

Which way the camera faces (World, User).

Since

Lens Scripting Version 387


location

readonly location: CameraLocation

Exposes user dataSPECS

Camera position on the device (Left, Right).

Since

Lens Scripting Version 387


name

readonly name: string

Exposes user dataSPECS

Human-readable camera name from the camera service. Informational only.

Since

Lens Scripting Version 387


type

readonly type: CameraType

Exposes user dataSPECS

Camera sensor type (Rgb, Grayscale).

Since

Lens Scripting Version 387

Methods

getStreams()

getStreams(): StreamInfo[]

Exposes user dataSPECS

The stream capabilities of this camera, sorted largest-first by pixel area. Select one whose CameraModule.StreamInfo#operation matches the session you intend to use. The same resolution and format can appear once for each operation.

Returns

StreamInfo[]

Array of stream capabilities. Pass one to CameraModule.StreamConfig#stream.

Since

Lens Scripting Version 387

Example

let cameraModule = require('LensStudio:CameraModule');
cameraModule.getCameras().forEach(function (camera) {
camera.getStreams().forEach(function (stream) {
let streaming = stream.operation == CameraModule.Operation.Streaming;
print(stream.width + 'x' + stream.height + (streaming ? ' streaming' : ' capture'));
});
});

getTypeName()

static getTypeName(): TypeName<CameraInfo>

Exposes user dataSPECS

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<CameraInfo>

Since

Lens Scripting Version 387

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame