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.20

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

30

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 [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,
  videoStabilizationMode,
  hideStatusBar,
  startswitch: false, // Only needed for overrides
  killswitch: false, // Only needed for overrides
};

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

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}
  useLocation={true}
  forceUseLocation={false}
  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>
;