Commit Graph
25 Commits
Author SHA1 Message Date
Nicolas Morin cebc0601d1 Fix cropToPreview on Android 2018-01-24 10:01:16 +01:00
Daniel Levitt 6039a63344 Possible zoom for android 2018-01-22 10:12:29 +00:00
Oscar Franco c7c3caa49a Merge pull request #948 from SteffenUlrich/master
correct aproach for delta error
2018-01-12 20:34:17 +01:00
Marcus Andersson ed2768828b fixed some formatting issues. 2017-12-20 20:19:14 +01:00
Marcus Andersson c6ad435532 added support for android to crop image to preview. 2017-12-19 15:03:08 +01:00
SteffenUlrich b5baca03e8 correct aproach for delta error 2017-10-18 14:37:56 +02:00
pkwak-sf f696610115 Fix issue with updating props quickly causing released camera object to be accessed. (#507) 2016-12-10 08:15:52 -05:00
Ron Heft b308d08e9a Race conditions initializing flashMode (#436)
* Fix race condition initializing Android camera

* Fix race condition initializing flashMode iOS
2016-12-08 21:05:35 -05: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
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
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
plougsgaard 05b5fc727d Support hints for a subset of the barcode types. 2016-09-15 21:30:00 +02:00
plougsgaard b5af30248e Add internal prop determining if barcode scanner is wanted. 2016-09-15 01:16:19 +02:00
Kyle Corbitt 1e581d7c97 Set the device orientation before instantiating RCTCamera (#368) 2016-09-12 20:20:46 -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 a378edabbc replace System.console with Log.e (#390) 2016-09-01 11:55:22 -07: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
Radu-Marius Popovici 0c3dba1ff6 fix snapshot orientation when device orientation is locked (#232)
* use device orientation on android only with auto orientation

* guard against missing playSoundOnCapture and quality props in options

* add video orientation support

* use device orientation on ios only with auto orientation
2016-05-10 11:05:03 -07:00
Radu Popovici 4ab7a9d220 fix android snapshot orientation when device orientation is locked 2016-03-23 14:16:39 +02:00
Radu Popovici 5659cc7809 add captureQuality option 2016-03-20 21:31:23 +02:00
Radu Popovici 8ace4fa7cb fix front camera rotation 2016-02-18 18:10:56 +02:00
Fabrice Armisen 844d6aaf65 Android support.
Working: set aspect, select camera type, set flash/torch mode, take picture and save it to the file system, mediaroll as data.
Not working: Video capture, set orientation.
Known problem: Front camera pictures are not oriented correctly.
2016-01-19 18:31:14 -08:00
Lochlan Wansbrough c844f2bfac Removed left over import. Updated Android stuff. 2015-09-21 21:21:08 -07:00
Lochlan Wansbrough 3172ed7060 Stubbed Android support. 2015-09-21 20:22:56 -07:00