# useLocalMedia Read camera, microphone and screen capture snapshots. ## Import ```tsx import { useLocalMedia, MediaLoader } from '@relayrtc/react' ``` ## Requirements Call this hook inside [RelayProvider](/reference/sdk/client/react/RelayProvider), in a React function component or custom hook. A joined room is needed for live data and actions. ## Returns | Field | Type | Meaning | | --- | --- | --- | | microphone | RoomInputSnapshot or null | Microphone capture/publication state. | | camera | RoomInputSnapshot or null | Camera capture/publication state. | | screen | RoomScreenSnapshot or null | Display capture/publication state. | ## Example ```tsx const { camera } = useLocalMedia() return (
{camera?.enabled ? 'Camera enabled' : 'Camera off'}