Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ddayguerrero committed Feb 12, 2022
1 parent ace7b76 commit b9065e8
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# use-media-capabilities
<br>

React Hook to extract information about the decoding and encoding capabilities of a given audio or video format.
<h1 align="center">use-media-capabilities</h1>
<h4 align="center">A <a href="https://reactjs.org">React</a> hook to extract information about the decoding and encoding capabilities of a given audio or video format.</h3>
<br>

## Getting Started

### Quick Start

```shell
npm install use-media-capabilities
```

### Example
```tsx
import { useAudioCapabilities } from 'use-media-capabilities';

function EncodingStatus() {
const {encodingProfile} = useAudioCapabilities({
contentType: "audio/flac",
channels: "2",
bitrate: 128000,
samplerate: 16000,
});

return (
<div> Encoding for audio configuration is {encodingProfile.type === 'valid' && encodingProfile.powerEfficient ? '' : 'not' } power efficient.
</div>
);
}
```

0 comments on commit b9065e8

Please sign in to comment.