-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ace7b76
commit b9065e8
Showing
1 changed file
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} | ||
``` |