import { Meta } from '@storybook/blocks'; # VideoInputProvider Provides a list of the user's available video input devices and the currently selected video input device. ## State ```ts { // A list of the user's available video input devices devices: [{ deviceId: string; label: string; }], // The current selected video input device selectedDevice: VideoInputDevice | undefined; } ``` You can access the provided values using [useVideoInputs](/docs/sdk-hooks-usevideoinputs--page) hook. ## Importing ```javascript import { VideoInputProvider } from 'amazon-chime-sdk-component-library-react'; ``` ## Usage If you are using `MeetingProvider`, `VideoInputProvider` is rendered by default. ```jsx import React from 'react'; import { MeetingProvider, useVideoInputs, } from 'amazon-chime-sdk-component-library-react'; const App = () => ( ); const MyChild = () => { const { devices, selectedDevice } = useVideoInputs(); const items = devices.map((device) => (
  • {device.label}
  • )); return (

    Current Selected Video Input Device: {JSON.stringify(selectedDevice)}

    Devices

    ); }; ``` ### Dependencies - `MeetingProvider`