import { Meta } from '@storybook/blocks';

<Meta title="SDK Hooks/useSelectVideoQuality" />

# useSelectVideoQuality

The `useSelectVideoQuality` hook returns a function that you can select the user's video input quality.

### Return Value

```javascript
(VideoQuality) => void;

type VideoQuality = '360p' | '540p' | '720p';
```

## Importing

```javascript
import { useSelectVideoQuality } from 'amazon-chime-sdk-component-library-react';
```

## Usage

The hook depends on the `AudioVideoProvider`. If you are using `MeetingProvider`, it is rendered by default.

```jsx
import React from 'react';
import { MeetingProvider, useSelectVideoQuality } from 'amazon-chime-sdk-component-library-react';

const App = () => (
  <MeetingProvider>
    <MyChild />
  </MeetingProvider>
);

const MyChild = () => {
  const selectVideoQuality = useSelectVideoQuality();

  return (
    <button onClick={() => selectVideoQuality('360p')}> 360p video input quality </button>
    <button onClick={() => selectVideoQuality('540p')}> 540p video input quality </button>
    <button onClick={() => selectVideoQuality('720p')}> 720p video input quality </button>
  )
}
```

### Dependencies

- `AudioVideoProvider`
