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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@fe-free/react-native-uvc-camera

v0.1.1

Published

一个 React Native 组件,用于预览 UVC 相机。 对应的 Demo https://github.com/frontend-free/RNUVCCamera

Downloads

217

Readme

react-native-uvc-camera

一个 React Native 组件,用于预览 UVC 相机。 对应的 Demo https://github.com/frontend-free/RNUVCCamera

功能

  • 支持预览多个 UVC 相机
  • 支持插拔
  • 目前支持 Android

如果你需要更多功能,请 fork 或者联系我们!

使用

android/app/build.gradle 中添加

android {
		// 添加这三行代码
		buildFeatures {
        dataBinding true
    }
}

dependencies {
    // The version of react-native is set by the React Native Gradle Plugin
    implementation("com.facebook.react:react-android")
    // 添加这行代码
    implementation 'androidx.databinding:databinding-runtime:8.7.3'
    if (hermesEnabled.toBoolean()) {
        implementation("com.facebook.react:hermes-android")
    } else {
        implementation jscFlavor
    }
}

AndroidManifest.xml 中添加

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
			// 添加这行代码
      android:hardwareAccelerated="true"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme"
      // 添加这行代码
      android:requestLegacyExternalStorage="true"
      android:supportsRtl="true">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
    </application>
</manifest>

android.build.gradle 中

  // 调整到 27
  targetSdkVersion = 27

代码接入

import { UVCCameraWithIndex } from "@fe-free/react-native-uvc-camera";

const Home = () => {
  return (
    <View>
      <Text>相机 1</Text>
      <View style={styles.cameraView}>
        <UVCCameraWithIndex index={0} />
      </View>
      <Text>相机 2</Text>
      <View style={styles.cameraView}>
        <UVCCameraWithIndex index={1} />
      </View>
    </View>
  );
};

const styles = StyleSheet.create({
  cameraView: {
    width: "100%",
    height: 240,
    backgroundColor: "#000",
  },
});

什么是 UVC ?

经历

背景:我需要一个能预览多个 UVC 摄像头画面的组件。 困难:没有找到能用的组件。这中间有各种原因:存在 Android 原生能力的不足; 存在 ReactNative 的版本迭代太快;存在 react-native 的生态不活跃。 最终:我们基于 https://github.com/jiangdongguo/AndroidUSBCamera 做了些改造和封装,同时 Shared 出来

在此之前我们尝试了

  • https://github.com/saki4510t/UVCCamera android 原生
  • https://github.com/flyskywhy/react-native-uvc-camera 最终没跑起来
  • https://github.com/and2long/react-native-uvc-camera 只支持一个
  • https://github.com/mrousavy/react-native-vision-camera 只支持前后置摄像头
  • https://github.com/jiangdongguo/AndroidUSBCamera android 原生库。

感谢

联系和捐赠

联系我

捐赠