Valora
API Reference@valora-ai/reactindexFunctions

useFacingMode

function useFacingMode(trackReference): FacingMode | undefined;

Defined in: packages/react/src/hooks/device/useFacingMode.ts:46

Note. This feature is experimental and may change or be removed based on developer feedback and real-world usage. Try to determine the facingMode of a local participant video track.

Parameters

ParameterType
trackReferenceunknown

Returns

FacingMode | undefined

Example

// Basic — read the camera facing mode for a local video track.
const facingMode = useFacingMode(trackReference);

// Advanced — label local camera tracks by physical direction.
function CameraFacingLabel({ trackRef }: { trackRef: TrackReferenceOrPlaceholder }) {
  const facingMode = useFacingMode(trackRef);
  const isMuted = useIsMuted(trackRef);

  return (
    <span>
      {isMuted ? "Camera muted" : facingMode ?? "Camera direction unknown"}
    </span>
  );
}

On this page

Valora is local-first

No API key, no server — everything in this doc runs on-device.

Star on GitHub