@bengreenier/react-user-media
v0.1.2
Published
A collection of hooks and components for easier access to getUserMedia, getDisplayMedia, and enumerateDevices in React.
Downloads
17
Readme
react-user-media
A collection of hooks and components for easier access to getUserMedia, getDisplayMedia, and enumerateDevices in React.
Hooks
useMedia('user')useMedia('display')useMediaTracks(...)useMediaAudioTracks(...)useMediaVideoTracks(...)useTrackMuteState(...)
useMediaDevices()useMediaAudioInputDevices()useMediaAudioOutputDevices()useMediaVideoDevices()
useMediaRecorder()
Components
AudioPlayerVideoPlayer
Utility functions
getSupportedConstraints()closeMedia(...)
Contributing
Please feel free to open any issues or PRs!
Building locally
This project uses pnpm for dependency management, and expects a local Node.js installation for dev and testing.
Then just pnpm run:
build- builds the projectdev- starts hosting the examples for local development.test- runs tests.lint- runs the linter.
License
Dual-licensed under Apache 2.0 + MIT.
