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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@prasiddha-n/react-native-uvc-camera

v0.2.13

Published

UVC Camera for RN

Readme

react-native-uvc-camera

UVC camera component for React Native powered by UVCAndroid.
Android only.

Installation

npm install @prasiddha-n/react-native-uvc-camera

Quick start

import React, { useEffect, useRef } from 'react';
import { SafeAreaView, StyleSheet } from 'react-native';
import { UVCCamera } from '@prasiddha-n/react-native-uvc-camera';

export function UvcScreen() {
  const cameraRef = useRef<UVCCamera>(null);

  useEffect(() => {
    cameraRef.current?.openCamera();
    return () => cameraRef.current?.closeCamera();
  }, []);

  const capture = async () => {
    const photo = await cameraRef.current?.takePhoto();
    console.log(photo?.path);
  };

  return (
    <SafeAreaView style={styles.container}>
      <UVCCamera ref={cameraRef} style={styles.camera} />
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: { flex: 1, backgroundColor: '#000' },
  camera: { flex: 1 },
});

Add your own UI button to call capture() when you need a still image.

API surface

<UVCCamera /> is a pure view that forwards all standard ViewProps. Every interaction happens through the ref.

Imperative methods

| Method | What it does | | --- | --- | | openCamera() | Starts discovery, picks the preferred UVC device, and begins streaming to the surface. | | closeCamera() | Stops the preview and releases the active USB camera. Call on unmount or app background. | | takePhoto(): Promise<PhotoFile> | Captures a JPEG to the device temp dir and returns { path }. Add file:// when displaying the image. | | updateAspectRatio(width, height) | Persists a preferred preview size. The closest matching mode is selected on the next openCamera(). | | setCameraBright(value) | Forwards value to the UVC brightness control (library expects a 0–100 percentage). | | setCameraContrast(value) | Sets UVC contrast (integer range depends on the camera; usually 0–255). | | setCameraSaturation(value) | Adjusts saturation via the UVC control (device-specific range). | | setCameraSharpness(value) | Updates sharpness (device-specific range). | | setCameraZoom(value) | Sends a relative zoom value to the camera and toggles autofocus. Default is 500. | | setDefaultCameraVendorId(vendorId) | Stores the USB vendor id to auto-select when multiple cameras are connected. Provide the decimal form (e.g. 0x0bda3034). |

All setters resolve immediately; they don’t reject even if the device silently ignores out-of-range values. Clamp inputs on the JS side if your hardware requires specific limits.

Example: tweaking controls

await cameraRef.current?.updateAspectRatio(1920, 1080);
await cameraRef.current?.setCameraBright(70);
await cameraRef.current?.setCameraContrast(40);
await cameraRef.current?.setCameraSaturation(128);
await cameraRef.current?.setCameraSharpness(64);
await cameraRef.current?.setCameraZoom(600);
await cameraRef.current?.setDefaultCameraVendorId(3034);

PhotoFile shape

type PhotoFile = {
  path: string; // temp file path, prepend file:// for <Image />
};

Remember that temp files may be deleted when the app closes—move them if you need persistence.

R8 / ProGuard

If you are using R8 the shrinking and obfuscation rules are included automatically.

ProGuard users must manually add the below options.

-keep class com.herohan.uvcapp.** { *; }
-keep class com.serenegiant.usb.** { *; }
-keepclassmembers class * implements com.serenegiant.usb.IButtonCallback {*;}
-keepclassmembers class * implements com.serenegiant.usb.IFrameCallback {*;}
-keepclassmembers class * implements com.serenegiant.usb.IStatusCallback {*;}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library