npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-uvc-camera

v2.0.2

Published

A USB video class Camera component for React Native

Downloads

64

Readme

React Native UVC Camera

npm version npm downloads npm licence Platform

A React Native component to access to UVC web camera on non-rooted Android device, a combination of React Native Camera and UVCCamera .

For RN0.70.5, UvcCameraManager branch main is an example. Since react-native-camera is deprecated in favor of react-native-vision-camera, now react-native-uvc-camera@2 has merged all code in [email protected], so

npm uninstall react-native-camera
npm install react-native-uvc-camera

For RN0.51.0, UvcCameraManager branch master is an example.

npm install [email protected] [email protected]

and read README.md of [email protected].

Installation (Android)

  • Add android/local.properties , android-ndk need just r14b in NDK Archives, e.g.
# must be absolute path, otherwise will got
# `Task ':libuvccamera:ndkBuild' is not up-to-date because: Task has not declared any outputs despite executing actions`
ndk.dir=D\:\\proj\\tools\\android-ndk-r14b
  • In android/settings.gradle
include ':usbCameraCommon'
project(':usbCameraCommon').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-uvc-camera/usbCameraCommon')
include ':libuvccamera'
project(':libuvccamera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-uvc-camera/libuvccamera')
  • In android/app/src/main/AndroidManifest.xml
...
    <uses-permission android:name="android.permission.CAMERA" />

To enable video recording feature you have to add the following code:

    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
repositories {
    maven {
        url 'https://raw.githubusercontent.com/saki4510t/libcommon/master/repository'
        allowInsecureProtocol = true
    }
}

If Could not get resource 'https://raw.github.com/saki4510t/libcommon/master/repository/com/serenegiant/common/1.5.21/common-1.5.21.aar'. while compile, then you may need set proxy whicn can quickly access github.com in ~/.gradle/gradle.properties e.g.:

#systemProp.https.proxyHost=192.168.19.49
#systemProp.https.proxyPort=1001

Usage

Take a look into this RNCamera doc.

UvcCamera Properties additional to RNCamera:

rotation

Values: 0, 90, 180, or 270.

Most USB cameras have different rotation by default. It adjusts your camera rotation by your own.

Customization

As said in android/src/main/java/com/google/android/cameraview/CameraUvc.java :

    public void onStartPreview(){
        // some USB camera will not return onPictureTaken and onVideoRecorded by uncomment some of below, test them by your own
        // updateAutoFocus();
        // updateFlash();
        // updateFocusDepth();
        // updateWhiteBalance();
        // updateZoom();
    }

Donate

To support my work, please consider donate.

  • ETH: 0xd02fa2738dcbba988904b5a9ef123f7a957dbb3e