switchCamera

Requires:
@ray-js/lock-sdk≥1.2.0

Method signature
switchCamera(index: number)

Description

Switch the camera to the specified index

Parameters

ParameterTypeRequiredDescription
indexnumberYesCamera index (starting from 0)

Return Value

Type: Promise<true>
Switched successfully

Error Code

Error CodeError Message
1002Operation timed out
1104Failed to switch camera
1105Switching cameras is not supported

Examples

import { switchCamera } from '@ray-js/lock-sdk';
await switchCamera(1); // Switch to the next camera