0.1.2 • Published 12 months ago

@bengreenier/react-user-media v0.1.2

Weekly downloads
-
License
-
Repository
-
Last release
12 months ago

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

  • AudioPlayer
  • VideoPlayer

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 project
  • dev - starts hosting the examples for local development.
  • test - runs tests.
  • lint - runs the linter.

License

Dual-licensed under Apache 2.0 + MIT.

0.1.2

12 months ago

0.1.1

1 year ago

0.1.0

1 year ago