UNPKG

@daily-co/daily-react

Version:

Daily React makes it easier to integrate [@daily-co/daily-js](https://www.npmjs.com/package/@daily-co/daily-js) in React applications.

66 lines (65 loc) 3.44 kB
/** * This hook allows access to information about the user's devices and their state. */ export declare const useDevices: () => { /** * Most recent error object emitted via [camera-error event](https://docs.daily.co/reference/daily-js/events/meeting-events#camera-error). */ cameraError: import("@daily-co/daily-js").DailyCamPermissionsError | import("@daily-co/daily-js").DailyCamDeviceNotFoundError | import("@daily-co/daily-js").DailyCamConstraintsError | import("@daily-co/daily-js").DailyCamInUseError | import("@daily-co/daily-js").DailyCamTypeError | import("@daily-co/daily-js").DailyCamUnknownError | null; /** * A list of the user's camera (videoinput) devices. See [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo) for more info. */ cameras: import("../DailyDevices").StatefulDevice[]; /** * The general state for camera access. */ camState: "idle" | "pending" | "not-supported" | "granted" | "blocked" | "in-use" | "not-found" | "constraints-invalid" | "constraints-none-specified" | "undefined-mediadevices" | "unknown"; /** * Holds the currently selected camera. */ currentCam: import("../DailyDevices").StatefulDevice | undefined; /** * Holds the currently selected microphone. */ currentMic: import("../DailyDevices").StatefulDevice | undefined; /** * Holds the currently selected speaker. */ currentSpeaker: import("../DailyDevices").StatefulDevice | undefined; /** * Indicates that there's an issue with camera devices. */ hasCamError: boolean; /** * Indicates that there's an issue with microphone devices. */ hasMicError: boolean; /** * A list of the user's microphone (audioinput) devices. See [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo) for more info. */ microphones: import("../DailyDevices").StatefulDevice[]; /** * The general state for microphone access. */ micState: "idle" | "pending" | "not-supported" | "granted" | "blocked" | "in-use" | "not-found" | "constraints-invalid" | "constraints-none-specified" | "undefined-mediadevices" | "unknown"; /** * Refreshes the list of devices using [enumerateDevices](https://docs.daily.co/reference/daily-js/instance-methods/enumerate-devices). */ refreshDevices: () => Promise<void>; /** * Allows to switch to the camera with the specified deviceId. Calls [setInputDevicesAsync](https://docs.daily.co/reference/daily-js/instance-methods/set-input-devices-async) internally. */ setCamera: (deviceId: string) => Promise<void>; /** * Allows to switch to the microphone with the specified deviceId. Calls [setInputDevicesAsync](https://docs.daily.co/reference/daily-js/instance-methods/set-input-devices-async) internally. */ setMicrophone: (deviceId: string) => Promise<void>; /** * Allows to switch to the speaker with the specified deviceId. Calls [setOutputDevice](https://docs.daily.co/reference/daily-js/instance-methods/set-output-device) internally. */ setSpeaker: (deviceId: string) => Promise<void>; /** * A list of the user's speaker (audiooutput) devices. See [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo) for more info. */ speakers: import("../DailyDevices").StatefulDevice[]; };