Appearance
Device Orientation
The SDK supports the setting of the device orientation in face measurement sessions. The orientation is determined by the application during the session creation and can be set according to the current device orientation at the time the session is created, or according to the preferred UI orientation.
The orientation is defined as the position of the native base of the device (also commonly known as the charging port location), relative to the device's current rotation. For example, if the device is rotated so its base is to the left of the user, then the orientation is defined as LANDSCAPE_LEFT.
Upon session creation, if no specific orientaion is requested, the legal orientation is the device's orientation once 'start' is being called.
In the following example, the device orientation is LANDSCAPE_LEFT:
TypeScript
import healthMonitorManager, {
FaceSessionOptions,
DeviceOrientation
} from '@biosensesignal/web-sdk';
await healthMonitorManager.initialize({
licenseKey,
});
const options: FaceSessionOptions = {
input: video.current,
cameraDeviceId: cameraId,
processingTime,
onVitalSign,
onFinalResults,
onError,
onWarning,
onStateChange,
onImageData,
orientation: DeviceOrientation.PORTRAIT,
};
const faceSession = await healthMonitorManager.createFaceSession(options); The SDK defines the possible device orientations as an enum:
TypeScript
export enum DeviceOrientation {
PORTRAIT,
LANDSCAPE_LEFT,
LANDSCAPE_RIGHT
}When the device orientation differs from the requested orientation during a measurement, then:
- The SDK will indicate that the image orientation is incorrect as part of Image Validity.
- Images with an incorrect orientation will not be processed by the SDK.