Commit Graph

334 Commits

Author SHA1 Message Date
Benjamin Toueg 3a20709f64 Minor: Remove duplicate if (#487) 2016-11-26 13:07:07 -05:00
Loch Wansbrough 69d6b5acbf Update README.md 2016-11-23 12:59:36 -08:00
Locly 154cb7aa58 Added Camera.constants.CaptureQuality.preview for android to allow the outputted image to be exactly the same as the previewed image (#449) 2016-11-21 19:41:19 -05:00
Zack Story e4536fd896 Update README.md 2016-11-20 15:12:45 -08:00
rt2zz a8c07ff4fd 0.4.0 2016-11-20 15:10:17 -08:00
Ian Bussières 3f04dd3587 Fix crash on second invocation of camera when running on iOS 10 simulator (#441) 2016-11-18 17:45:21 -05:00
James 6fe07c48ae Explicitly added instructions for the Camera Usage Description for iO… (#478)
* Explicitly added instructions for the Camera Usage Description for iOS 10

* Added NSPhotLib field as well
2016-11-18 17:42:03 -05:00
abrahambotros a2a6d028a4 Add 1080p, 720p, and 480p capture qualities. (#469)
* Add 1080p, 720p, and 480p capture qualities.

* Minor improvements for picture/video sizing.

- Minor refactoring for getting supported sizes (DRY).
- Add explicit pictureSize setting for 480p/720p/1080p in still/picture mode.

* Use util.Size objects for 480p/720p/1080p sizing.

- Note using Camera.Size objects would require a camera instance prior to creating the
  size objects, which would be manageable but not too clean.

* Remove 480p for iOS; 16:9/HD aspect ratio for Android 480p

- iOS only has a 640x480 480p-like AVCaptureSessionPreset, which is not the typical 16:9/HD aspect ratio
  desired. Removing this option as a result of this.
- Android 480p updated to use 16:9/HD aspect ratio.

* Add notes for (in)exact sizing for 1080p/720p/480p

* Re-add 480p on iOS, more notes on resolutions.

- Add notes on non-HD-aspect-ratio for iOS 480p.
- Add more explanation of variable resolution/sizes, especially for 480p on Android.

* Use custom Resolution class to hold 480p/720p/1080p resolution sizes

- Mistakenly used util.Size class before, which was not added until Android API level 21 (current
  min is 16).
2016-11-18 17:38:23 -05:00
Jonathan Chen adb26f4524 Default captureAudio to false (#420)
* Default captureAudio to false

Since default captureMode is a still picture, not video. 

This also works around some new iOS 10 permissions requiring notifying the user with a reason for using microphone (which is not good for the user experience if they're just taking a picture). Reference: https://github.com/lwansbrough/react-native-camera/issues/386#issuecomment-249007206

If you need video and sound, then explicitly pass it through as props in your Camera component.

* Update readme for default audio setting
2016-11-18 17:35:26 -05:00
Nicolas Charpentier 4badcd2596 Merge pull request #480 from lwansbrough/update-example
Update example
2016-11-18 16:31:37 -05:00
rt2zz 26070b58d0 remove gitignore 2016-11-17 22:29:08 -08:00
abrahambotros b16ec4ab75 Minor Android MediaRecorder, sizing, and file improvements (#477)
Android MediaRecorder:
  - Most importantly, call Camera.unlock() before setting the camera on the
    MediaRecorder instance, and release() not just reset() when releasing the MediaRecorder
    instance!
  - Add comments and notes for preparing and releasing MediaRecorder instance.
  - Add onError callback for errors during recording session.

RCTCameraViewManager, RCTCamera, RCTCameraViewFinder, RCTCameraView:
  - Implement setCaptureMode, preparing camera based on captureMode. Currently, the only step that
    needs to be taken here is setting the recording hint for videos.
  - Handle setting _captureMode instance variable where applicable.

Sizing
  - Determine ViewFinder supported sizes based on actual captureMode (i.e., get supported picture
    sizes when in still capture mode, and get supported video sizes when in video capture mode).

Output files:
  - Get appropriate external storage public directory based on media type (image or video).
  - Minor variable renaming to indicate that both images or videos can be saved.

README:
  - Update captureTarget to indicate that cameraRoll is the actual default for both systems.
  - Small clarification for output data type for deprecated memory captureTarget output.
2016-11-17 22:25:51 -08:00
Livio Bieri fb3b12b4f1 README: Updated Requirements for iOS 10 (#445) 2016-10-12 20:35:13 -04:00
Andrew Jack a51041e41a Fix .gitignore and add .npmignore (#455) 2016-10-12 20:34:40 -04:00
Zack Story 6074ec3c82 Merge pull request #423 from node-vision/master
Fix for issue #386 - camera cras- ios 10 simulator
2016-09-26 07:50:04 +02:00
Roman Mandryk 000c09a2cc Fix for issue #386 - camera cras- ios 10 simulator 2016-09-24 21:18:41 +08:00
Nicolas Charpentier 880f469082 Update Example to RN 0.34 and Xcode 8 2016-09-23 16:08:56 -04:00
Zack Story 1747ec4b0a Merge pull request #413 from plougsgaard/android-barcode-scanner-rebased
Android Barcode Scanner
2016-09-16 22:50:52 -07:00
plougsgaard 05b5fc727d Support hints for a subset of the barcode types. 2016-09-15 21:30:00 +02:00
plougsgaard 918c00f003 Apply barcode scanner on preview frames. 2016-09-15 01:17:24 +02:00
plougsgaard ce11617743 Add event emitter for android. 2016-09-15 01:16:20 +02:00
plougsgaard 85336e9fd4 Import the zxing decoder library. 2016-09-15 01:16:20 +02:00
plougsgaard 2a33908c4f Expose the react application context as a singleton. 2016-09-15 01:16:19 +02:00
plougsgaard b5af30248e Add internal prop determining if barcode scanner is wanted. 2016-09-15 01:16:19 +02:00
Chris Duke d15022d560 Fix bug 357. Setting preview callback to null before camera release. (#410) 2016-09-13 14:17:45 -07:00
Gonzalo Aguirre 22f79985b2 Add missing dependency (#411)
* Add mirrorImage support for Android

* Release resources after mirroring

* Mirror image only for TYPE_FRONT

* Remove unnecessary annotation

* Document mirrorImage for Android

* Improved compression and error handling

* Add support for mirroring on Android back camera too
2016-09-13 14:16:27 -07:00
Gonzalo Aguirre b01c64e773 Mirror image for Android (#399)
* Add mirrorImage support for Android

* Release resources after mirroring

* Mirror image only for TYPE_FRONT

* Remove unnecessary annotation

* Document mirrorImage for Android

* Improved compression and error handling

* Add support for mirroring on Android back camera too
2016-09-13 09:48:48 -07:00
jacobSingh 2bbdf8ce91 Update README.md (#407) 2016-09-13 02:08:25 -07:00
David 3ff9a5852a Update Readme (#406)
for everyone that links it manually  - see: https://github.com/lwansbrough/react-native-camera/issues/164
2016-09-13 01:21:28 -07:00
matejkriz f4bf30e17b prevent freezing when opened 2 times via navigator (http://stackoverflow.com/questions/33046061/) (#380) 2016-09-12 20:31:46 -07:00
Sergio Navarrete Suárez ae88ac7405 Updates README.md: Manual Android install (#385)
Changes MainActivity.java to MainApplication.java.

For people with little or no Java experience, it also ensures the list returned by getPackages() is separated by a coma.
2016-09-12 20:30:02 -07:00
Marc Johnson 046970feca Android video flipped rotated #388 and activity pause support (#394)
* Initial commit with Android video support

* stopCapture now works

* Bug fixes and parameter enhancements.  README updated.

* Modified stopCapture parameter count to match iOS

* fixed promise bug on stopCapture

* Update RCTCameraModule.java

In Android preview and recording sizes are different, which can cause an error.  This fix detects the difference and chooses a recording resolution that matches.

* Update RCTCameraModule.java

* Update RCTCamera.java

Creating video functions in style/convention of existing

* Update RCTCameraModule.java

Use new functions for adjusting video capture size and quality

* Update RCTCameraModule.java

Fixes issue where file not video playable (readable) on older devices

* Update AndroidManifest.xml

Since we're reading and writing video and pictures, need permissions for it.

* Fixed upside down camera (on some platforms), and misc bugs and crashes

* Added camera-roll and capture to memory support, new options, and support for duration, filesize, and metadata

* To make merge nicer, temporarily reverting "Added camera-roll and capture to memory support, new options, and support for duration, filesize, and metadata"

This reverts commit 9ea1ad409c7e6121cf0197172e752b7523d4b092.

* Fixed merge & brought back all improvements from 9ea1ad4

* Fixed logic for video -> camera roll

* Updates

* Uncommenting setProfile

* Fix support for React Native 0.25

* Renamed Camera to index

* * Fix after merge android recording

* * Fixed android camera roll file saving
* Added recording to example

* * Android promise rejections with exceptions
* Fixed preview, video and photo sizes
* Android recording result in new, javascript object, format

* * Removed example.index.android.js as there is Example project

* * Readme for example

* don't force a specific codec

* always use cache dir

* * Using MediaScannerConnection instead of ACTION_MEDIA_SCANNER_SCAN_FILE intent

* * As described in https://github.com/lwansbrough/react-native-camera/pull/262#issuecomment-239622268:
- fixed video the wrong direction and recoder start fail at "low,medium" on the nexus 5 x

* Fix minor orientation bug with front recording on android

* (Android) Made video stop on activity pause

* Revert "Merge pull request #6 from Reaction-Framework/marcejohnson-master"

This reverts commit 8729c65a72af2afc8297e4a4de3c07a54da11580, reversing
changes made to 50416eb0daae447b822307f257c31a1cbc240a2c.

* Revert "Revert "Merge pull request #6 from Reaction-Framework/marcejohnson-master""

This reverts commit 4b87b48c7bd92840566ad76c96961325c2291ee0.

* replace System.console with Log.e (#390)
2016-09-12 20:29:14 -07:00
Kyle Corbitt 1e581d7c97 Set the device orientation before instantiating RCTCamera (#368) 2016-09-12 20:20:46 -07:00
dcmdestello 14836aef58 Fix setFlashMode was calling setTorchMode. (#396) 2016-09-05 10:36:07 -07:00
Kyle Corbitt 6834e594f4 adjusted rotation should be that of camera, not display (#393) 2016-09-03 12:35:09 -07:00
Kyle Corbitt 696d55af01 record method not documented, shouldn't be exposed (#392) 2016-09-03 12:34:18 -07:00
Kyle Corbitt a378edabbc replace System.console with Log.e (#390) 2016-09-01 11:55:22 -07:00
anativ be8b89c5cc fix example jsCodeLocation (#360) 2016-08-27 21:56:44 -04:00
Marc Johnson e326d51a53 Android support for recording video (#262)
* Initial commit with Android video support

* stopCapture now works

* Bug fixes and parameter enhancements.  README updated.

* Modified stopCapture parameter count to match iOS

* fixed promise bug on stopCapture

* Update RCTCameraModule.java

In Android preview and recording sizes are different, which can cause an error.  This fix detects the difference and chooses a recording resolution that matches.

* Update RCTCameraModule.java

* Update RCTCamera.java

Creating video functions in style/convention of existing

* Update RCTCameraModule.java

Use new functions for adjusting video capture size and quality

* Update RCTCameraModule.java

Fixes issue where file not video playable (readable) on older devices

* Update AndroidManifest.xml

Since we're reading and writing video and pictures, need permissions for it.

* Fixed upside down camera (on some platforms), and misc bugs and crashes

* Added camera-roll and capture to memory support, new options, and support for duration, filesize, and metadata

* To make merge nicer, temporarily reverting "Added camera-roll and capture to memory support, new options, and support for duration, filesize, and metadata"

This reverts commit 9ea1ad409c7e6121cf0197172e752b7523d4b092.

* Fixed merge & brought back all improvements from 9ea1ad4

* Fixed logic for video -> camera roll

* Updates

* Uncommenting setProfile

* Fix support for React Native 0.25

* Renamed Camera to index

* * Fix after merge android recording

* * Fixed android camera roll file saving
* Added recording to example

* * Android promise rejections with exceptions
* Fixed preview, video and photo sizes
* Android recording result in new, javascript object, format

* * Removed example.index.android.js as there is Example project

* * Readme for example

* don't force a specific codec

* always use cache dir

* * Using MediaScannerConnection instead of ACTION_MEDIA_SCANNER_SCAN_FILE intent

* * As described in https://github.com/lwansbrough/react-native-camera/pull/262#issuecomment-239622268:
- fixed video the wrong direction and recoder start fail at "low,medium" on the nexus 5 x
2016-08-27 21:49:46 -04:00
Chad Wilken 1e092b5573 Check if console is not null as preferred by https://developer.android.com/reference/java/io/Console.html (#381) 2016-08-24 23:16:54 -07:00
Tuomas Peippo 355a6daea3 Move setCaptureQuality outside of capture function (#322) 2016-08-02 16:22:15 -04:00
Gethin Webster 2444964ead Ensure that preview orientation is correct on launch (#354) 2016-08-01 18:22:35 -07:00
Jason Marshall 1032370749 rnpm is part of react-native now (#355) 2016-08-01 18:19:41 -07:00
Nicolas Charpentier 9ddc787cb5 Merge pull request #334 from king6cong/example-fix
fix Example js bundle failure
2016-07-11 09:33:04 -04:00
king6cong d8cdbd6b0f fix Example js bundle failure 2016-07-04 21:26:32 +08:00
Zack Story d4d1aec581 add z orientation comment, closes #308 2016-07-02 20:59:13 -07:00
gchiocchio 6f989a51bd Fix Z-Order issue child item Camera Android 2016-07-02 20:44:48 -07:00
Jonathan Stanton 0d32769dac Add podspec (#329)
* Add podspec file

* Add instructions for CocoaPods
2016-07-02 12:01:43 -07:00
Nicolas Charpentier 75093a36d8 Merge pull request #312 from stantoncbradley/master
add commitConfiguration to stopSession
2016-06-27 11:44:11 -04:00
Nicolas Charpentier e1f04e082a Merge pull request #304 from charpeni/example
Add example
2016-06-14 09:16:25 -04:00