Commit Graph

27 Commits

Author SHA1 Message Date
Marcus Andersson e546ae852c fixed merge conflicts. 2018-01-08 21:12:39 +01:00
Sibelius Seraphini 30af527ac3 merge with master 2018-01-07 09:06:20 -08:00
Oscar Franco 6749e9e19b [ENHANCEMENT] Add permission handling for android 6+ 2018-01-06 08:54:40 +01:00
Oscar Franco 7fb27917d2 (android) Add missing permissions to Example project 2018-01-05 10:48:13 +01:00
Sibelius Seraphini ab357b2f57 feat(example): upgrade example to latest rn version 51 2017-12-31 13:13:29 -02:00
Marcus Andersson 93177c8604 changed so we use the correct exceptions. 2017-12-20 20:25:01 +01:00
Marcus Andersson e5777136b1 fixed flex. 2017-12-20 20:19:14 +01:00
Marcus Andersson 03b76bd542 turned cropping of in example. 2017-12-20 20:19:14 +01:00
Marcus Andersson c51f0b5f93 fixed so android cropping works in all orientations. 2017-12-20 20:19:14 +01:00
Marcus Andersson ec4ac6c74b fixed so camera works in all orientations for ios 2017-12-20 20:19:14 +01:00
Marcus Andersson da1f0f2fdd changed so we use the cropToPreview parameter to crop the image 2017-12-20 20:19:05 +01:00
skovhus 4f4aaf9a02 Fix example failing with "Unable to resolve module react" 2017-10-06 14:38:36 +02:00
mannol 161c568095 (android): Remove nonexistant Android permission (#863)
Android does not have RECORD_VIDEO permission. For a list of available permissions check [this link](https://developer.android.com/reference/android/Manifest.permission.html).
2017-08-29 11:26:19 -07:00
Ruben Maher 8937d44e1e (example): Fix the example (#692) 2017-05-04 22:39:45 -07:00
Abe Botros 860aeb761a (demo): Set more precise React/React-Native package version dependencies for Example (#679)
* Set more precise React/React-Native package version dependencies

- In general, try to avoid breaking changes caused by >=
  - In particular, such a breaking change can be seen by testing the current Example
    app on Android with the existing package.json's and RN 0.43+, which causes errors
    in MainApplication public/protected method settings.

* Revert changes to main package.json

- Would erroneously break compatibility for main package
- Leave precise dependencies only for Example app, since this does not impact
  compatibility in the same way
2017-04-24 09:55:54 -07:00
Abe Botros ae9eab3533 (android): Android tap-to-focus and improved (continuous) auto-focus (#575)
* Android tap-to-focus and improved (continuous) auto-focus

Tap-to-focus

- On tap, compute focus area around motion event's location, and pass this to the camera parameters
  as the new focus area.
- Adds RCTCameraUtils.java file, so far with only a single function that helps compute the focus area
  from a motion event. This file can serve as a location for utility constants and functions for the
  rest of the app, where such things can be extracted out.

Improved (continuous) auto-focus

- Use FOCUS_MODE_CONTINUOUS_PICTURE/VIDEO when possible to enable continuous auto-focus; fall back to
  FOCUS_MODE_AUTO otherwise, if able.

Other changes

- Update README to specify differences between iOS and Android for focus and zoom functionality.
- Update AndroidManifest with more thorough list of permissions and features.
- Update Example package.json react and react-native dependencies to match root package's package.json.

* Example: default empty onFocusChanged callback

- Enables default tap-to-focus behavior in Example app, facilitating
  testing of focus features in the Example app
2017-04-24 09:25:49 -07:00
Abe Botros 20b0721850 iOS: minor focus and zoom changes (#578)
* iOS: minor focus and zoom changes

RCTCameraManager focusAtThePoint improvements
- Dynamicaly get size from bounds of camera view, instead of full screen, since
  it might not always be the case that the Camera react component is taking up
  the entire device screen.
- Also add setting exposure to the same point of interest we are focusing on.

Example
- Add onFocusChanged and onZoomChanged empty callback functions by default to
  Example app, allowing tap-to-focus and pinch-to-zoom to be readily
  experienced/experimented with.
- Updated react/react-native dependencies to match root package.json.

TODO/Other remarks
- Tap-to-focus seems to still not work perfectly... From logging, it always seems
  to get the right location in the view (meaning its getting the right location
  from the user touch and transforming it to the {0, 1} range appropriately), and
  does indeed engage the focus process, but it seems it sometimes refocuses on the
  center-ish region of what's in the camera instead of the location that was actually
  pressed. I thought this might be related to the subjectAreaDidChange getting called,
  which in turn sets the focus mode to continuous auto-focus at the view center, but
  from my experimenting, this method never actually gets called. I wasn't able to
  figure out if there's somewhere else in the library that's forcing continuous auto-focus,
  or if there's just some bug in our current focus procedure within focusAtThePoint.

* Reset Example/package.json dependency versions to master
2017-04-23 14:01:04 -07:00
Nazar Yablonskiy b1ea73bbb4 fix example 2017-02-27 21:26:21 +02:00
Gregorio Setti bd40d8a4cf Fix #506 (#525) 2016-12-21 08:35:44 -08:00
rt2zz 26070b58d0 remove gitignore 2016-11-17 22:29:08 -08:00
Andrew Jack a51041e41a Fix .gitignore and add .npmignore (#455) 2016-10-12 20:34:40 -04:00
Nicolas Charpentier 880f469082 Update Example to RN 0.34 and Xcode 8 2016-09-23 16:08:56 -04: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
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
king6cong d8cdbd6b0f fix Example js bundle failure 2016-07-04 21:26:32 +08:00
Nicolas Charpentier 1024c6bed5 Add example 2016-05-30 11:19:43 -04:00