Skip to main content
getCameraFacingMode() Returns the facing mode of the currently active camera: 'user' (front-facing) or 'environment' (rear-facing). Returns null if the facing mode cannot be determined.

Return value

Returns a Promise<DailyCameraFacingMode | null> where DailyCameraFacingMode is 'user' | 'environment'.

Example

const facingMode = await call.getCameraFacingMode();
if (facingMode === 'environment') {
  console.log('Using rear camera');
} else if (facingMode === 'user') {
  console.log('Using front camera');
}

See also