Options for the useMediaDevices hook.

interface UseMediaDeviceOptions {
    deviceChangedEvent?: boolean;
    filter?: ((device: MediaDeviceInfo) => boolean);
}

Properties

deviceChangedEvent?: boolean

An optional flag that causes the https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/devicechange_event|devicechange event to be monitored, automatically requesting updated devices as needed.

Default: true.

filter?: ((device: MediaDeviceInfo) => boolean)

An optional filter to further limit the results.

Type declaration

    • (device): boolean
    • Parameters

      • device: MediaDeviceInfo

        the device to process.

      Returns boolean

      true when included, false when excluded.

      Default: () => true.