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

@meddly/rn-vision-camera

v0.1.8

Published

- **Follow setup instructions for the following libraries** - [react-native-vision-camera](https://github.com/mrousavy/react-native-vision-camera) - [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated) - [react-nati

Downloads

7

Readme

Setup

Overview

Features:

  • Image & Video Capture
  • Gesture Controls
    • Pinch to Zoom
    • Tap to focus
    • Custom Gestures via props
      • onDoubleTap
      • onSwipeLeft
      • onSwipeRight
      • onSwipeUp
      • onSwipeDown
  • Portrait / Landscape UI for right and left handed individuals
  • Save to camera roll
  • Flash
  • Custom icons, custom top bar, custom middle section, left / right of record / snap icons, and custom bottom bar
  • Component Example (includes all props)
  • Camera settings: control state and hook into component
    • Flash
    • Viewport
    • Video / Photo Mode
import Camera from '@meddly/rn-vision-camera';

const [isVideo, setIsVideo] = useState<boolean>(true);
const [frontCamera, setFrontCamera] = useState<boolean>(false);
const [flash, setFlash] = useState<string>('auto');
const [videoStabilizationMode, setVideoStabilizationMode] =
  useState<VideoStabilizationMode>('auto');
const [preset, setPreset] = useState<CameraPreset>('high');
const [hideStatusBar, setHideStatusBar] = useState<boolean>(false);
const [isRecording, setIsRecording] = useState<boolean>(false);

/*/
 * startRecording:
 *  - can be async
 *  - must return true to start recording
 * stopRecording:
 *  - can be async
 *  - must return true to stop recording
/*/

const stateActions = {
  startRecording: () => true,
  stopRecording: () => true,
  getDeviceInfo: (x: CameraDevice) => console.log('Device Info: ', x)
};

const cameraState = {
  isVideo,
  frontCamera,
  flash,
  isRecording,
  videoStabilizationMode,
  preset,
  hideStatusBar,
  killswitch: false, // Only needed for overrides
};

const cameraConfig = {
  photo: true, // Required
  video: true, // Required
  nameConvention: 'Plethora',
};

const customComponents = {
  // Main Sections
  cameraTop: {
    component: <Text>Top</Text>,
  },
  cameraMiddle: {
    component: <Text>Middle</Text>,
  },
  cameraAboveControls: {
    component: <Text>Above Camera</Text>,
  },
  cameraBottom: {
    component: <Text>Bottom</Text>,
  },

  // Camera Controls Section
  cameraControlsLeft: {
    component: <Text>Left</Text>,
  },
  cameraControlsPrimary: {
    component: (
      <Text>{isVideo ? (isRecording ? 'Stop' : 'Start') : 'Photo'}</Text>
    ),
  },
  cameraControlsRight: {
    component: <Text>Right</Text>,
  },

  // Alternatively, you don't want to add custom logic to ,
  // cameraControlsPrimary you can use the built-in camera
  // controls and just add custom icons
  // Note: if you use both, cameraControlsPrimary will take precedence

  // Camera Control Icons
  icons: {
    takePictureIcon: <Text>SNP</Text>,
    startRecordingIcon: <Text>REC</Text>,
    stopRecordingIcon: <Text>STP</Text>,
  },
};

const sectionHeights = {
  top: 100,
  bottom: 100,
};

// Render
<MeddlyCamera
  // Camera Config
  config={config}
  isFocused={true}
  cameraState={cameraState}
  stateActions={stateActions}
  sectionHeights={sectionHeights}
  hideNoDeviceFound={true}
  // Pre-Built Actions
  showCameraControls={true}
  saveToCameraRoll={true}
  // Lifecycle Events
  onIsRecording={val => setIsRecording(val)}
  onTakePicture={res => console.log('onTakePicture', res)}
  onRecordingStart={res => console.log('onRecordingStart', res)}
  onRecordingFinished={res => console.log('onRecordingFinished', res)}
  onRecordingError={e => console.log('onRecordingError', e)}
  onOrientationChange={val => console.log('onOrientationChange', val)}
  // Custom Gesture Controls
  onDoubleTap={res => console.log('onDoubleTap', res)}
  swipeDistance={200}
  onSwipeLeft={res => console.log('onSwipeLeft', res)}
  onSwipeRight={res => console.log('onSwipeRight', res)}
  onSwipeUp={res => console.log('onSwipeUp', res)}
  onSwipeDown={res => console.log('onSwipeDown', res)}>
  {customComponents}
</MeddlyCamera>
;

Notes

  • Currently running react-native-vison-camera version 2.16.5
    • To get started..
      1. Go go: ./node_modules/react-native-vison-camera/android/build.gradle"
      2. Line 138 - Change: minSdkVersion 21 to: minSdkVersion getExtOrIntegerDefault('minSdkVersion')
    • To upgrade to version 3.0.0, permissions values authorized must be changed to granted in the following files
      • ./src/components/RenderCamera.tsx
      • ./src/MeddlyCamera.tsx
    • FPS stuff has been commented out in 2.16.1. Uncomment FPS in ./src/components/RenderCamera.tsx if running react-native-vison-camera version 3.0.0

Roadmap

  • Add: Write Geolocation data to file metadata