0.1.6 • Published 11 months ago

react-native-pure-camera v0.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
11 months ago

react-native-pure-camera

This is a module which help you take photo or take video.

Installation

npm i react-native-pure-camera
// link below 0.60
react-native link react-native-pure-camera

Setup

iOS

Add NSCameraUsageDescription in your ios/${ProjectName}/Info.plist:

<key>NSCameraUsageDescription</key>
<string>balabala</string>

Android

Add jitpack in your android/build.gradle at the end of repositories:

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

Usage

import camera from 'react-native-pure-camera'

// At first, make sure you have the permissions.
// ios: CAMERA
// android: CAMERA RECORD_AUDIO

// If you don't have these permissions, you can't call open method.

camera.open({

  // photo: take photo only
  // video: take video only
  // photo_video: take photo by tap, take video by long press
  // default value: 'photo_video'
  captureMode: 'photo|video|photo_video',

  photoBase64Enabled: true,

  // the text above the take button
  // default value: ''
  guideLabelTitle: '轻触拍照,按住摄像',

  // video min duration in milliseconds
  // default value: 1000
  videoMinDuration: 1000,

  // video max duration in milliseconds
  // default value: 10000
  videoMaxDuration: 10000,

})
.then(data => {

  // if you take video, data.video is the output video.
  data.video

  // if you take photo, data.photo is the output photo.
  // if you take video, data.photo is the first frame of the video
  data.photo

})
.catch(() => {
  // click cancel button
})
0.1.4

12 months ago

0.1.6

11 months ago

0.1.5

12 months ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago