CameraModule.CameraInfo
ClassA physical camera on SPECS, returned by CameraModule#getCameras.
- Snapchat: not supported
- SPECS: fully supported
- Camera Kit Web: not supported
- Camera Kit Mobile: not supported
- 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
Since Lens Scripting v387Exposes user data
A physical camera on SPECS, returned by CameraModule#getCameras.
Index
Properties
Methods
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
readonlyfacing:CameraFacing
Exposes user dataSPECS
Which way the camera faces (World, User).
Since
Lens Scripting Version 387
location
readonlylocation:CameraLocation
Exposes user dataSPECS
Camera position on the device (Left, Right).
Since
Lens Scripting Version 387
name
readonlyname:string
Exposes user dataSPECS
Human-readable camera name from the camera service. Informational only.
Since
Lens Scripting Version 387
type
readonlytype: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
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()
staticgetTypeName():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
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
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
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean